fix shutdown command

This commit is contained in:
2026-01-22 20:09:55 +03:00
parent 637537161d
commit 436ab88e9c
+3 -2
View File
@@ -23,10 +23,11 @@ export class Shutdown extends ChatCommand {
requirements = Requirements.Build(Requirement.BOT_CREATOR); requirements = Requirements.Build(Requirement.BOT_CREATOR);
async execute(msg: Message): Promise<void> { async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
await bot.sendMessage({chat_id: msg.chat.id, text: "..."}).catch(logError); 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) { for (const text of texts) {
await delay(randomValue(timings)); await delay(randomValue(timings));
await bot.sendMessage({chat_id: msg.chat.id, text: text}).catch(logError); await bot.sendMessage({chat_id: msg.chat.id, text: text}).catch(logError);