Updated "blacklist" to be "banlist"
This commit is contained in:
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 => {
|
||||
|
||||
21
src/lib/tiktokLinkCheck.ts
Normal file
21
src/lib/tiktokLinkCheck.ts
Normal 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;
|
||||
Reference in New Issue
Block a user