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);