From 436ab88e9cdb779f5bdc52dcfba02e5d6f293463 Mon Sep 17 00:00:00 2001 From: Danil Nikolaev Date: Thu, 22 Jan 2026 20:09:55 +0300 Subject: [PATCH] fix shutdown command --- src/commands/shutdown.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/shutdown.ts b/src/commands/shutdown.ts index 34604eb..9cef187 100644 --- a/src/commands/shutdown.ts +++ b/src/commands/shutdown.ts @@ -23,10 +23,11 @@ export class Shutdown extends ChatCommand { requirements = Requirements.Build(Requirement.BOT_CREATOR); - async execute(msg: Message): Promise { + async execute(msg: Message, match?: RegExpExecArray): Promise { await bot.sendMessage({chat_id: msg.chat.id, text: "..."}).catch(logError); - if (msg.chat.type !== "private" && !msg.text.toLowerCase().startsWith("/shutdown now")) { + const now = match?.[3]?.toLowerCase() === "now"; + if (msg.chat.type !== "private" && !now) { for (const text of texts) { await delay(randomValue(timings)); await bot.sendMessage({chat_id: msg.chat.id, text: text}).catch(logError);