From 10c84e1582f833f3ba2cb2758e7544d2e9289e8a Mon Sep 17 00:00:00 2001 From: Lucid Date: Tue, 21 Oct 2025 14:13:40 -0400 Subject: [PATCH] Changed bot features to .hears and used regex to detect commands. --- src/bot/features/botInfoCommand.ts | 4 ++-- src/bot/features/helpCommand.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bot/features/botInfoCommand.ts b/src/bot/features/botInfoCommand.ts index 137235f..77a2b6e 100644 --- a/src/bot/features/botInfoCommand.ts +++ b/src/bot/features/botInfoCommand.ts @@ -10,8 +10,8 @@ const feature = composer.chatType(["private", "group", "supergroup"]); * What triggers this feature and adds to the log when it has been triggered. * The trigger is the command "/botInfo" */ -feature.command( - "botInfo", +feature.hears( + /^\/botInfo/, logHandle("bot-info-command"), async (ctx: Context) => { // Checks if the context includes a message property. diff --git a/src/bot/features/helpCommand.ts b/src/bot/features/helpCommand.ts index a769110..a224c6c 100644 --- a/src/bot/features/helpCommand.ts +++ b/src/bot/features/helpCommand.ts @@ -10,7 +10,7 @@ const feature = composer.chatType(["group", "supergroup", "private"]); * What triggers this feature and adds to the log when it has been triggered. * The trigger is the command "/help" */ -feature.command("help", logHandle("help"), async (ctx: Context) => { +feature.hears(/^\/help/, logHandle("help"), async (ctx: Context) => { const GROUP_IDS = process.env.GROUP_IDS ? process.env.GROUP_IDS.split(",") : undefined;