Updated "blacklist" to be "banlist"
This commit is contained in:
@@ -17,7 +17,7 @@ const feature = composer.chatType(["group", "supergroup"]);
|
|||||||
*/
|
*/
|
||||||
feature.hears(
|
feature.hears(
|
||||||
metaRegex,
|
metaRegex,
|
||||||
logHandle("blacklist-detection-meta"),
|
logHandle("banlist-detection-meta"),
|
||||||
async (ctx: Context) => {
|
async (ctx: Context) => {
|
||||||
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
|
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(
|
feature.hears(
|
||||||
twitterRegex,
|
twitterRegex,
|
||||||
logHandle("blacklist-detection-twitter"),
|
logHandle("banlist-detection-twitter"),
|
||||||
async (ctx: Context) => {
|
async (ctx: Context) => {
|
||||||
const mutationKey = process.env.GRAPHQL_MUTATION_KEY || "";
|
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.
|
* 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
|
* @returns flag
|
||||||
*/
|
*/
|
||||||
const metaLinkCheck = (linkUrl: string): boolean => {
|
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