mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-08-31 06:05:22 +00:00
make warning forward links case insensitive.
This commit is contained in:
@@ -98,7 +98,8 @@ const removeLinks = async ({ message, chat, reply, state, update }, next) => {
|
||||
// and if they are ads
|
||||
username = username
|
||||
.replace(/.*((t.me)|(telegram.(me|dog)))\//gi, '@')
|
||||
.replace(/\/\d+/gi, '');
|
||||
.replace(/\/\d+/gi, '')
|
||||
.toLowerCase();
|
||||
|
||||
try {
|
||||
const { type } = await bot.telegram.getChat(username);
|
||||
@@ -106,7 +107,9 @@ const removeLinks = async ({ message, chat, reply, state, update }, next) => {
|
||||
if (
|
||||
!excludeLinks
|
||||
.some(knownLink =>
|
||||
knownLink.includes(username.replace('@', '')))
|
||||
knownLink
|
||||
.toLowerCase()
|
||||
.includes(username.replace('@', '')))
|
||||
) {
|
||||
isAd = true;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user