Updated "blacklist" to be "banlist"

This commit is contained in:
2026-01-26 19:52:57 -05:00
parent b8db58a71a
commit 299530b0dd
4 changed files with 26 additions and 5 deletions

View File

@@ -17,7 +17,7 @@ const feature = composer.chatType(["group", "supergroup"]);
*/
feature.hears(
metaRegex,
logHandle("blacklist-detection-meta"),
logHandle("banlist-detection-meta"),
async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
@@ -64,4 +64,4 @@ feature.hears(
}
);
export { composer as metaBlacklist };
export { composer as metaBanlist };

View File

@@ -17,7 +17,7 @@ const feature = composer.chatType(["group", "supergroup"]);
*/
feature.hears(
twitterRegex,
logHandle("blacklist-detection-twitter"),
logHandle("banlist-detection-twitter"),
async (ctx: Context) => {
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
@@ -64,4 +64,4 @@ feature.hears(
}
);
export { composer as twitterBlacklist };
export { composer as twitterBanlist };

View File

@@ -5,7 +5,7 @@ const metaRegex =
/**
* This function will check if a url matches Meta services links using regex.
*
* @param linkUrl representing a suspected blacklisted url
* @param linkUrl representing a suspected url on the banlist
* @returns flag
*/
const metaLinkCheck = (linkUrl: string): boolean => {

View File

@@ -0,0 +1,21 @@
// Global regex used to detect TikTok links.
const tiktokRegex = /(tiktok\.com)/gi;
/**
* This function will check if a url matches TikTok services links using regex.
*
* @param linkUrl representing a suspected url on the banlist
* @return flag
*/
const tiktokLinkCheck = (linkUrl: string): boolean => {
let flag = false;
if (linkUrl.match(tiktokRegex)) {
flag = true;
}
return flag;
};
export { tiktokRegex };
export default tiktokLinkCheck;