mirror of
https://github.com/tiennm99/claude-status-webhook.git
synced 2026-09-10 04:19:31 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user