From f7751b23a8559d9f9695b6985ae57c21a290ccee Mon Sep 17 00:00:00 2001 From: Lucid Kobold Date: Mon, 20 Oct 2025 20:07:28 -0400 Subject: [PATCH] Updated commands to not check for group IDs. --- src/bot/features/metaBlacklist.ts | 67 ++++++++++++++---------- src/bot/features/twitterBlacklist.ts | 77 ++++++++++++++++------------ 2 files changed, 83 insertions(+), 61 deletions(-) diff --git a/src/bot/features/metaBlacklist.ts b/src/bot/features/metaBlacklist.ts index a099a8f..dc774aa 100644 --- a/src/bot/features/metaBlacklist.ts +++ b/src/bot/features/metaBlacklist.ts @@ -21,35 +21,46 @@ feature.hears( : undefined; if (ctx.chat && ctx.msg) { - if (GROUP_IDS !== undefined) { - // Checking if the message is from a whitelisted group. - const groupID = ctx.chat.id; - const flag = GROUP_IDS.includes(`${groupID}`); - const username = ctx.msg.from?.username; - - if (flag) { - // Deletes the offending message. - ctx.msg.delete(); - // Replies to the user informing them of the action. - return await ctx.reply( - `@${username} Facebook and meta links along with with links to meta\\-owned services are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, - { parse_mode: "MarkdownV2" } - ); - } - } - - // If the env variables are misconfigured an error is sent to the group. - if (!GROUP_IDS) { - console.info("Group IDS:", process.env.GROUP_IDS); - return await ctx.reply( - `There was a problem retrieving the whitelist\\. Check the env variables and try again\\.`, - { - parse_mode: "MarkdownV2", - reply_parameters: { message_id: ctx.msg.message_id } - } - ); - } + const username = ctx.msg.from?.username; + // Deletes the offending message. + ctx.msg.delete(); + // Replies to the user informing them of the action. + return await ctx.reply( + `@${username} Facebook and meta links along with with links to meta\\-owned services are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, + { parse_mode: "MarkdownV2" } + ); } + + // if (ctx.chat && ctx.msg) { + // if (GROUP_IDS !== undefined) { + // // Checking if the message is from a whitelisted group. + // const groupID = ctx.chat.id; + // const flag = GROUP_IDS.includes(`${groupID}`); + // const username = ctx.msg.from?.username; + + // if (flag) { + // // Deletes the offending message. + // ctx.msg.delete(); + // // Replies to the user informing them of the action. + // return await ctx.reply( + // `@${username} Facebook and meta links along with with links to meta\\-owned services are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, + // { parse_mode: "MarkdownV2" } + // ); + // } + // } + + // // If the env variables are misconfigured an error is sent to the group. + // if (!GROUP_IDS) { + // console.info("Group IDS:", process.env.GROUP_IDS); + // return await ctx.reply( + // `There was a problem retrieving the whitelist\\. Check the env variables and try again\\.`, + // { + // parse_mode: "MarkdownV2", + // reply_parameters: { message_id: ctx.msg.message_id } + // } + // ); + // } + // } } ); diff --git a/src/bot/features/twitterBlacklist.ts b/src/bot/features/twitterBlacklist.ts index 9ee8056..d23c33a 100644 --- a/src/bot/features/twitterBlacklist.ts +++ b/src/bot/features/twitterBlacklist.ts @@ -21,40 +21,51 @@ feature.hears( : undefined; if (ctx.chat && ctx.msg) { - if (GROUP_IDS !== undefined) { - // Checking if the message is from a whitelisted group. - const groupID = ctx.chat.id; - const flag = GROUP_IDS.includes(`${groupID}`); - const username = ctx.msg.from?.username; - - if (flag) { - // Deletes the offending message. - ctx.msg.delete(); - // Replies to the user informing them of the action. - return await ctx.reply( - `@${username} Twitter and X links along with reformatting services for Twitter posts are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, - { parse_mode: "MarkdownV2" } - ); - } - } - - // If the env variables are misconfigured an error is sent to the group. - if (!GROUP_IDS) { - console.info( - "Group IDS:", - process.env.GROUP_IDS, - GROUP_IDS, - GROUP_IDS !== undefined - ); - return await ctx.reply( - `There was a problem retrieving the whitelist\\. Check the env variables and try again\\.`, - { - parse_mode: "MarkdownV2", - reply_parameters: { message_id: ctx.msg.message_id } - } - ); - } + const username = ctx.msg.from?.username; + // Deletes the offending message. + ctx.msg.delete(); + // Replies to the user informing them of the action. + return await ctx.reply( + `@${username} Twitter and X links along with reformatting services for Twitter posts are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, + { parse_mode: "MarkdownV2" } + ); } + + // if (ctx.chat && ctx.msg) { + // if (GROUP_IDS !== undefined) { + // // Checking if the message is from a whitelisted group. + // const groupID = ctx.chat.id; + // const flag = GROUP_IDS.includes(`${groupID}`); + // const username = ctx.msg.from?.username; + + // if (flag) { + // // Deletes the offending message. + // ctx.msg.delete(); + // // Replies to the user informing them of the action. + // return await ctx.reply( + // `@${username} Twitter and X links along with reformatting services for Twitter posts are not allowed here\\. Please consider sharing the media directly or from other social media sources or websites\\. No administration action was taken against you other than the message being deleted\\.`, + // { parse_mode: "MarkdownV2" } + // ); + // } + // } + + // // If the env variables are misconfigured an error is sent to the group. + // if (!GROUP_IDS) { + // console.info( + // "Group IDS:", + // process.env.GROUP_IDS, + // GROUP_IDS, + // GROUP_IDS !== undefined + // ); + // return await ctx.reply( + // `There was a problem retrieving the whitelist\\. Check the env variables and try again\\.`, + // { + // parse_mode: "MarkdownV2", + // reply_parameters: { message_id: ctx.msg.message_id } + // } + // ); + // } + // } } );