@iletai/nzb 1.2.2 → 1.2.3
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/telegram/bot.js +18 -0
- package/package.json +1 -1
package/dist/telegram/bot.js
CHANGED
|
@@ -247,6 +247,11 @@ export function createBot() {
|
|
|
247
247
|
const replyParams = { message_id: userMessageId };
|
|
248
248
|
const msgPreview = ctx.message.text.length > 80 ? ctx.message.text.slice(0, 80) + "…" : ctx.message.text;
|
|
249
249
|
void logInfo(`📩 Message: ${msgPreview}`);
|
|
250
|
+
// React with 👀 to acknowledge message received
|
|
251
|
+
try {
|
|
252
|
+
await ctx.react("👀");
|
|
253
|
+
}
|
|
254
|
+
catch { /* reactions may not be available */ }
|
|
250
255
|
// Typing indicator — keeps sending "typing" action every 4s until the final
|
|
251
256
|
// response is delivered. We use bot.api directly for reliability, and await the
|
|
252
257
|
// first call so the user sees typing immediately before any async work begins.
|
|
@@ -425,11 +430,19 @@ export function createBot() {
|
|
|
425
430
|
if (placeholderMsgId && chunks.length === 1) {
|
|
426
431
|
try {
|
|
427
432
|
await bot.api.editMessageText(chatId, placeholderMsgId, chunks[0], { parse_mode: "MarkdownV2" });
|
|
433
|
+
try {
|
|
434
|
+
await bot.api.setMessageReaction(chatId, userMessageId, [{ type: "emoji", emoji: "👍" }]);
|
|
435
|
+
}
|
|
436
|
+
catch { }
|
|
428
437
|
return;
|
|
429
438
|
}
|
|
430
439
|
catch {
|
|
431
440
|
try {
|
|
432
441
|
await bot.api.editMessageText(chatId, placeholderMsgId, fallbackChunks[0]);
|
|
442
|
+
try {
|
|
443
|
+
await bot.api.setMessageReaction(chatId, userMessageId, [{ type: "emoji", emoji: "👍" }]);
|
|
444
|
+
}
|
|
445
|
+
catch { }
|
|
433
446
|
return;
|
|
434
447
|
}
|
|
435
448
|
catch {
|
|
@@ -482,6 +495,11 @@ export function createBot() {
|
|
|
482
495
|
/* ignore — placeholder stays but user has the real message */
|
|
483
496
|
}
|
|
484
497
|
}
|
|
498
|
+
// React ✅ on the user's original message to signal completion
|
|
499
|
+
try {
|
|
500
|
+
await bot.api.setMessageReaction(chatId, userMessageId, [{ type: "emoji", emoji: "👍" }]);
|
|
501
|
+
}
|
|
502
|
+
catch { /* reactions may not be available */ }
|
|
485
503
|
});
|
|
486
504
|
}
|
|
487
505
|
else {
|