diff --git a/src/bot/features/getGroupIDCommand.ts b/src/bot/features/getGroupIDCommand.ts index 4fa0bc4..d398ee5 100644 --- a/src/bot/features/getGroupIDCommand.ts +++ b/src/bot/features/getGroupIDCommand.ts @@ -6,14 +6,14 @@ const composer = new Composer(); const feature = composer.chatType(["group", "supergroup"]); -const GROUP_IDS = process.env.GROUP_IDS - ? process.env.GROUP_IDS.split(",") - : undefined; - feature.hears( "/getGroupID", logHandle("get-group-id"), async (ctx: Context) => { + const GROUP_IDS = process.env.GROUP_IDS + ? process.env.GROUP_IDS.split(",") + : undefined; + if (ctx.chat && ctx.msg) { if (GROUP_IDS !== undefined) { const groupID = ctx.chat.id; diff --git a/src/bot/features/helpCommand.ts b/src/bot/features/helpCommand.ts index 8f8977c..cb9e563 100644 --- a/src/bot/features/helpCommand.ts +++ b/src/bot/features/helpCommand.ts @@ -6,14 +6,14 @@ const composer = new Composer(); const feature = composer.chatType(["group", "supergroup"]); -const GROUP_IDS = process.env.GROUP_IDS - ? process.env.GROUP_IDS.split(",") - : undefined; - feature.hears( "/help", logHandle("blacklist-detection"), async (ctx: Context) => { + const GROUP_IDS = process.env.GROUP_IDS + ? process.env.GROUP_IDS.split(",") + : undefined; + if (ctx.chat && ctx.msg) { if (GROUP_IDS !== undefined) { const groupID = ctx.chat.id;