From afb0e3086fafacaea54a526bbdd3a15bb32b5191 Mon Sep 17 00:00:00 2001 From: Lucid Kobold <72232219+LucidKobold@users.noreply.github.com> Date: Fri, 28 Feb 2025 18:48:45 -0500 Subject: [PATCH] moved variable into function --- src/bot/features/getGroupIDCommand.ts | 8 ++++---- src/bot/features/helpCommand.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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;