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.
This commit is contained in:
2026-04-22 10:54:30 +07:00
parent 59ae67c889
commit c3969a062f
-20
View File
@@ -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(
"<b>Claude Status Bot</b>\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;
}