@effect-ak/tg-bot-client 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -1
- package/dist/index.js +22 -651
- package/dist/index.mjs +22 -605
- package/package.json +1 -1
- package/readme.md +11 -4
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -128,11 +128,10 @@ Take a look at examples [here](example)
|
|
|
128
128
|
Create a file named `bot.js` and add your bot's logic as shown below:
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
import { MESSAGE_EFFECTS, runTgChatBot, BotResponse } from "@effect-ak/tg-bot-client"
|
|
131
|
+
import { MESSAGE_EFFECTS, runTgChatBot, BotResponse, defineBot } from "@effect-ak/tg-bot-client"
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
on_message: (msg) => {
|
|
133
|
+
const BOT = defineBot({
|
|
134
|
+
on_message: (msg) => {
|
|
136
135
|
|
|
137
136
|
if (!msg.text) return BotResponse.ignore;
|
|
138
137
|
|
|
@@ -150,6 +149,14 @@ Take a look at examples [here](example)
|
|
|
150
149
|
})
|
|
151
150
|
}
|
|
152
151
|
})
|
|
152
|
+
|
|
153
|
+
runTgChatBot({
|
|
154
|
+
type: "fromJsonFile",
|
|
155
|
+
mode: {
|
|
156
|
+
type: "single",
|
|
157
|
+
...BOT
|
|
158
|
+
}
|
|
159
|
+
})
|
|
153
160
|
```
|
|
154
161
|
|
|
155
162
|
3. **Run the Bot**
|