Skip to content

Commit

Permalink
Add silent reply on search results
Browse files Browse the repository at this point in the history
  • Loading branch information
OperKH committed Feb 27, 2024
1 parent 36259df commit 1e0e6b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bot/commands/mediaTracker.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 1e0e6b3

Please sign in to comment.