Changed bot features to .hears and used regex to detect commands.
All checks were successful
Main / build-and-push-docker-image (20.x) (push) Successful in 3m10s

This commit is contained in:
2025-10-21 14:13:40 -04:00
parent b8d966410a
commit 10c84e1582
2 changed files with 3 additions and 3 deletions

View File

@@ -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.

View File

@@ -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;