Merge remote-tracking branch 'origin/master'
This commit is contained in:
+4
-2
@@ -6,7 +6,9 @@ from urllib.request import urlopen
|
|||||||
|
|
||||||
from telebot import types
|
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] = {}
|
WARNS: dict[int, int] = {}
|
||||||
|
|
||||||
@@ -145,4 +147,4 @@ def fetch_rule(index: int) -> str:
|
|||||||
|
|
||||||
|
|
||||||
def has_links(body: str) -> bool:
|
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
|
||||||
|
|||||||
@@ -186,6 +186,8 @@ class TestOthers(TestCase):
|
|||||||
params = (
|
params = (
|
||||||
(True, 'My bot https://t.me/bot.some'),
|
(True, 'My bot https://t.me/bot.some'),
|
||||||
(True, 'My bot http://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, 'My bot here'),
|
||||||
(False, 'I can use http'),
|
(False, 'I can use http'),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user