FIX: now check t.me in bio

This commit is contained in:
kotolex
2024-01-24 13:31:58 +05:00
parent 8067bb7f83
commit dc888c9f3c
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -6,7 +6,9 @@ from urllib.request import urlopen
from telebot import types
from .constants import SPAM, BAN_WORDS, NON_GRATA, ADMIN_ID, ONLY_RUS_LETTERS, ONLY_ENG_LETTERS, RULES_TEXT, SYMBOLS
from .constants import (
SPAM, BAN_WORDS, NON_GRATA, ADMIN_ID, ONLY_RUS_LETTERS, ONLY_ENG_LETTERS, RULES_TEXT, SYMBOLS, URL_RX
)
WARNS: dict[int, int] = {}
@@ -145,4 +147,4 @@ def fetch_rule(index: int) -> str:
def has_links(body: str) -> bool:
return "https://" in body or "http://" in body
return "https://" in body or "http://" in body or "t.me/" in body
+2
View File
@@ -186,6 +186,8 @@ class TestOthers(TestCase):
params = (
(True, 'My bot https://t.me/bot.some'),
(True, 'My bot http://t.me/bot.some'),
(True, 'My bot here https://t.me/bot.some '),
(True, 'My bot here t.me/+hENFI22TCQdkN2E'),
(False, 'My bot here'),
(False, 'I can use http'),
)