@effect-ak/tg-bot-client 0.4.0 → 0.4.2

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.js CHANGED
@@ -257,14 +257,19 @@ var fetchAndHandle = ({ state, settings, handlers }) => Micro2.gen(function* ()
257
257
  updateKey: Object.keys(update).at(1),
258
258
  name: error._tag
259
259
  });
260
- return Micro2.succeed(true);
260
+ return Micro2.succeed(void 0);
261
261
  })
262
262
  ),
263
263
  {
264
264
  concurrency: 10
265
265
  }
266
266
  ).pipe(
267
- Micro2.andThen((result) => result.every((error) => error == null))
267
+ Micro2.andThen((batchResult) => {
268
+ if (settings.log_level == "debug") {
269
+ console.debug("handle batch result", batchResult);
270
+ }
271
+ return !batchResult.every((error) => error == null);
272
+ })
268
273
  );
269
274
  if (lastUpdateId) {
270
275
  yield* execute("get_updates", {
@@ -327,6 +332,11 @@ var handleUpdate = (updateObject, settings, handlers) => Micro2.gen(function* ()
327
332
  }),
328
333
  Micro2.catchAll((error) => {
329
334
  handleUpdateError = error;
335
+ console.log("error", {
336
+ updateId: updateObject.update_id,
337
+ updateKey: Object.keys(update).at(1),
338
+ name: error._tag
339
+ });
330
340
  return Micro2.succeed(
331
341
  BotResponse.make({
332
342
  type: "message",
@@ -336,14 +346,7 @@ var handleUpdate = (updateObject, settings, handlers) => Micro2.gen(function* ()
336
346
  reply_parameters: {
337
347
  message_id: updateObject.message?.message_id
338
348
  }
339
- } : void 0,
340
- reply_markup: {
341
- inline_keyboard: [
342
- [
343
- { text: "Repeat", callback_data: "fix:123" }
344
- ]
345
- ]
346
- }
349
+ } : void 0
347
350
  })
348
351
  );
349
352
  })
package/dist/index.mjs CHANGED
@@ -211,14 +211,19 @@ var fetchAndHandle = ({ state, settings, handlers }) => Micro2.gen(function* ()
211
211
  updateKey: Object.keys(update).at(1),
212
212
  name: error._tag
213
213
  });
214
- return Micro2.succeed(true);
214
+ return Micro2.succeed(void 0);
215
215
  })
216
216
  ),
217
217
  {
218
218
  concurrency: 10
219
219
  }
220
220
  ).pipe(
221
- Micro2.andThen((result) => result.every((error) => error == null))
221
+ Micro2.andThen((batchResult) => {
222
+ if (settings.log_level == "debug") {
223
+ console.debug("handle batch result", batchResult);
224
+ }
225
+ return !batchResult.every((error) => error == null);
226
+ })
222
227
  );
223
228
  if (lastUpdateId) {
224
229
  yield* execute("get_updates", {
@@ -281,6 +286,11 @@ var handleUpdate = (updateObject, settings, handlers) => Micro2.gen(function* ()
281
286
  }),
282
287
  Micro2.catchAll((error) => {
283
288
  handleUpdateError = error;
289
+ console.log("error", {
290
+ updateId: updateObject.update_id,
291
+ updateKey: Object.keys(update).at(1),
292
+ name: error._tag
293
+ });
284
294
  return Micro2.succeed(
285
295
  BotResponse.make({
286
296
  type: "message",
@@ -290,14 +300,7 @@ var handleUpdate = (updateObject, settings, handlers) => Micro2.gen(function* ()
290
300
  reply_parameters: {
291
301
  message_id: updateObject.message?.message_id
292
302
  }
293
- } : void 0,
294
- reply_markup: {
295
- inline_keyboard: [
296
- [
297
- { text: "Repeat", callback_data: "fix:123" }
298
- ]
299
- ]
300
- }
303
+ } : void 0
301
304
  })
302
305
  );
303
306
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-ak/tg-bot-client",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "homepage": "https://effect-ak.github.io/telegram-bot-client",
5
5
  "author": {
6
6
  "name": "Aleksandr Kondaurov",