mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 00:02:28 +00:00
simplify
This commit is contained in:
1 parent
de3488b779
commit
099be349ab
11 files changed
+97
-122
No files matched your search
@@ -62,7 +62,7 @@ There is an example with more options in [./examples/squaring-bot.ts](./examples
|
||||
|
||||
You can run it with: `npx ts-node ./examples/squaring-bot.ts`
|
||||
|
||||
A complete bot using business chats, command keys and message updates: [SimpleX Calculator](../../apps/simplex-calculator-bot/).
|
||||
A larger example, with a business address and commands as keys: [SimpleX Calculator](../../apps/simplex-calculator-bot/).
|
||||
|
||||
## PostgreSQL backend
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
# Type Alias: EventSubscriberFunc\<K\>
|
||||
|
||||
> **EventSubscriberFunc**\<`K`\> = (`event`) => `void` \| `Promise`\<`void`\>
|
||||
> **EventSubscriberFunc**\<`K`\> = (`event`, `chat`) => `void` \| `Promise`\<`void`\>
|
||||
|
||||
Defined in: [src/api.ts:50](../src/api.ts#L50)
|
||||
|
||||
@@ -22,6 +22,10 @@ Defined in: [src/api.ts:50](../src/api.ts#L50)
|
||||
|
||||
`ChatEvent` & `object`
|
||||
|
||||
### chat
|
||||
|
||||
[`ChatApi`](api.Class.ChatApi.md)
|
||||
|
||||
## Returns
|
||||
|
||||
`void` \| `Promise`\<`void`\>
|
||||
@@ -18,7 +18,7 @@ Defined in: [src/bot.ts:108](../src/bot.ts#L108)
|
||||
|
||||
### onMessage
|
||||
|
||||
((`chatItem`, `content`) => `void` \| `Promise`\<`void`\>) \| `undefined`
|
||||
((`chatItem`, `content`, `chat`) => `void` \| `Promise`\<`void`\>) \| `undefined`
|
||||
|
||||
### commands
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ Defined in: [src/bot.ts:42](../src/bot.ts#L42)
|
||||
|
||||
#### Index Signature
|
||||
|
||||
\[`key`: `string`\]: ((`chatItem`, `command`) => `void` \| `Promise`\<`void`\>) \| `undefined`
|
||||
\[`key`: `string`\]: ((`chatItem`, `command`, `chat`) => `void` \| `Promise`\<`void`\>) \| `undefined`
|
||||
|
||||
***
|
||||
|
||||
### onMessage?
|
||||
|
||||
> `optional` **onMessage?**: (`chatItem`, `content`) => `void` \| `Promise`\<`void`\>
|
||||
> `optional` **onMessage?**: (`chatItem`, `content`, `chat`) => `void` \| `Promise`\<`void`\>
|
||||
|
||||
Defined in: [src/bot.ts:40](../src/bot.ts#L40)
|
||||
|
||||
@@ -54,6 +54,10 @@ Defined in: [src/bot.ts:40](../src/bot.ts#L40)
|
||||
|
||||
`MsgContent`
|
||||
|
||||
##### chat
|
||||
|
||||
[`ChatApi`](api.Class.ChatApi.md)
|
||||
|
||||
#### Returns
|
||||
|
||||
`void` \| `Promise`\<`void`\>
|
||||
|
||||
Reference in new issue
Block a user