From de278da6d1d270f9164befb614c880e11ed33e94 Mon Sep 17 00:00:00 2001 From: Lorenzo Corallo Date: Wed, 18 Mar 2026 20:06:12 +0100 Subject: [PATCH 1/2] feat: search command reply to --- src/commands/search.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/search.ts b/src/commands/search.ts index 735ed41..ea9512d 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -14,13 +14,14 @@ export const search = new CommandsCollection().createCommand({ scope: "both", description: "Search groups by title", args: [{ key: "query", optional: false, description: "Search query" }], - handler: async ({ context, args }) => { + handler: async ({ context, args, repliedTo }) => { const res = await api.tg.groups.search.query({ query: args.query, limit: LIMIT }) if (res.count === 0) { await context.reply( fmt(({ n, b, i }) => [b`🔎 Group Search`, n`${i`Query:`} ${b`${args.query}`}`, b`❌ No results`], { sep: "\n", - }) + }), + { reply_parameters: { message_id: repliedTo ? repliedTo.message_id : context.msgId } } ) return } @@ -46,6 +47,10 @@ export const search = new CommandsCollection().createCommand({ inlineKeyboard.url(g.title, g.link) }) - await context.reply(reply, { link_preview_options: { is_disabled: true }, reply_markup: inlineKeyboard }) + await context.reply(reply, { + link_preview_options: { is_disabled: true }, + reply_markup: inlineKeyboard, + reply_parameters: { message_id: repliedTo ? repliedTo.message_id : context.msgId }, + }) }, }) From 354986f9b488850ee9239ebe56114ce4916a91a5 Mon Sep 17 00:00:00 2001 From: Tommaso Morganti Date: Wed, 18 Mar 2026 20:12:57 +0100 Subject: [PATCH 2/2] fix: set reply as optional in command def --- src/commands/search.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/search.ts b/src/commands/search.ts index ea9512d..843eb3a 100644 --- a/src/commands/search.ts +++ b/src/commands/search.ts @@ -14,6 +14,7 @@ export const search = new CommandsCollection().createCommand({ scope: "both", description: "Search groups by title", args: [{ key: "query", optional: false, description: "Search query" }], + reply: "optional", handler: async ({ context, args, repliedTo }) => { const res = await api.tg.groups.search.query({ query: args.query, limit: LIMIT }) if (res.count === 0) {