2
0
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:
Pouria Ezzati
2018-02-02 00:29:16 +03:30
parent 150a1246bc
commit 789c42ddcd

View File

@@ -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;