mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-01 14:45:27 +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
|
// and if they are ads
|
||||||
username = username
|
username = username
|
||||||
.replace(/.*((t.me)|(telegram.(me|dog)))\//gi, '@')
|
.replace(/.*((t.me)|(telegram.(me|dog)))\//gi, '@')
|
||||||
.replace(/\/\d+/gi, '');
|
.replace(/\/\d+/gi, '')
|
||||||
|
.toLowerCase();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { type } = await bot.telegram.getChat(username);
|
const { type } = await bot.telegram.getChat(username);
|
||||||
@@ -106,7 +107,9 @@ const removeLinks = async ({ message, chat, reply, state, update }, next) => {
|
|||||||
if (
|
if (
|
||||||
!excludeLinks
|
!excludeLinks
|
||||||
.some(knownLink =>
|
.some(knownLink =>
|
||||||
knownLink.includes(username.replace('@', '')))
|
knownLink
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(username.replace('@', '')))
|
||||||
) {
|
) {
|
||||||
isAd = true;
|
isAd = true;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user