From 1e0e6b3f251405cb3a51f428b5171372a1e60103 Mon Sep 17 00:00:00 2001 From: Aleksandr Zhytnyk Date: Tue, 27 Feb 2024 11:34:24 +0200 Subject: [PATCH] Add silent reply on search results --- src/bot/commands/mediaTracker.command.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bot/commands/mediaTracker.command.ts b/src/bot/commands/mediaTracker.command.ts index 0ac88b1..595bfdb 100644 --- a/src/bot/commands/mediaTracker.command.ts +++ b/src/bot/commands/mediaTracker.command.ts @@ -78,7 +78,8 @@ export class MediaTrackerCommand extends Command { for (const { messageId, similarity } of messages) { const variantNumber = replyMessageCount++ % this.similarFoundVariants.length; await ctx.reply(`${this.similarFoundVariants[variantNumber]} (${Math.round(similarity * 1e4) / 1e2}%)`, { - reply_parameters: { message_id: Number(messageId) }, + reply_parameters: { message_id: Number(messageId), allow_sending_without_reply: true }, + disable_notification: true, }); // Wait 300ms before send next message await new Promise((r) => setTimeout(r, 300)); @@ -138,10 +139,11 @@ export class MediaTrackerCommand extends Command { for (const { messageId, similarity } of messages) { try { await ctx.reply(similarity.toPrecision(4), { - reply_parameters: { message_id: Number(messageId) }, + reply_parameters: { message_id: Number(messageId), allow_sending_without_reply: true }, + disable_notification: true, }); } catch (e) { - console.log(e); + console.log(`messageId: ${messageId}`, e); } // Wait 300ms before send next message await new Promise((r) => setTimeout(r, 300));