@effect-ak/tg-bot-client 0.4.2 → 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@effect-ak/tg-bot-client",
3
- "version": "0.4.2",
4
- "homepage": "https://effect-ak.github.io/telegram-bot-client",
3
+ "version": "0.5.1",
4
+ "homepage": "https://effect-ak.github.io/telegram-bot-playground/",
5
5
  "author": {
6
6
  "name": "Aleksandr Kondaurov",
7
7
  "email": "kondaurov.dev@gmail.com"
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
- runTgChatBot({
134
- type: "fromJsonFile",
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**