From c3969a062f8e52fa4dd4406f45ad6f81a218c8a7 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Wed, 22 Apr 2026 10:54:30 +0700 Subject: [PATCH] feat: only respond to registered commands, ignore other messages Drop the bot.on("message") fallback so non-command messages (plain text, joins, edits, unknown commands) no longer trigger a reply. --- src/bot-commands.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/bot-commands.js b/src/bot-commands.js index 728086a..95f161b 100644 --- a/src/bot-commands.js +++ b/src/bot-commands.js @@ -156,26 +156,6 @@ function createBot(token) { // Info commands: /help, /status, /history, /uptime registerInfoCommands(bot); - bot.on("message", async (ctx) => { - if (ctx.message?.pinned_message) return; - const replyTo = ctx.message?.reply_to_message; - if (replyTo && replyTo.from?.id === ctx.me.id) { - return; - } - await ctx.reply( - "Claude Status Bot\n\n" + - "/help — Detailed command guide\n" + - "/start — Subscribe to notifications\n" + - "/stop — Unsubscribe\n" + - "/info — Chat ID & subscription info\n" + - "/status — Current system status\n" + - "/subscribe — Notification preferences\n" + - "/history — Recent incidents\n" + - "/uptime — Component health overview", - { parse_mode: "HTML" } - ); - }); - return bot; }