From ce6dfecd23a99212ce9152da8679197e4c1788cf Mon Sep 17 00:00:00 2001 From: t Date: Mon, 13 Nov 2023 20:06:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=82=D1=80=D0=B0=D0=BD=D1=81=D0=BB=D0=B8=D1=82,=20?= =?UTF-8?q?=D1=81=D0=BF=D0=B5=D1=86=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB?= =?UTF-8?q?=D1=8B=20=D0=B8=202-=D0=B0=D1=8F=20=D0=BF=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D0=BA=D0=B0=20(=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B8=D0=BC=D0=B2=D0=BE=D0=BB=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=82=D0=BE=D1=87=D0=BA=D1=83,=20=D0=B2=D0=BC?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=BE=20=D0=BF=D1=83=D1=81=D1=82=D0=BE=D1=82?= =?UTF-8?q?=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- antimat.py | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/antimat.py b/antimat.py index a72eb2f..84cb6c3 100644 --- a/antimat.py +++ b/antimat.py @@ -41,6 +41,8 @@ bot = telebot.TeleBot(db['token']) from re import search, match, sub, compile def is_bad(word, bad, excepts): + #Replace spec.symbols + # Excepts if word in excepts: return False @@ -53,14 +55,30 @@ def is_bad(word, bad, excepts): else: return False +### TRANSLIT an OTHER ###### + +def rep(word): + rep = [['e','е'], ['a','а'], ['i','и'], ['t','т'], ['y','у'], ['u','у'], ['o','о'], ['d','д'], ['x','х'], ['t','т'], ['p','п'], + ['r','р'], ['h','х'], ['b','б'], ['n','н'], + ['🇽','х'], ['🇾','у'], ['🇹','т'], ['🇪','е'], + ['❌','х'], ['✖','х'], ['❎','х'] ] + + for i in rep: + word = word.replace(i[0], i[1]) + + print(word) + return word + ####### CATCH BAD WORDS #### def catch(message): - bad_list = ['х.+й', 'xуи', 'xyи', 'хyи', 'xyй', 'xуй', 'ху.', '.+хуё', 'xyu', 'xui', 'хyй', 'хй', 'поху', - 'бл.+ть', 'бля', 'блят', + bad_list = ['х.+й', 'xуи', 'xyи', 'хyи', 'xyй', 'xуй', 'ху.', '.+хуё', 'xyu', 'xui', 'хyй', 'поху', '.уй', 'ах.ен', 'а.уе', + 'бл.+ть', 'бля', 'бл.+т', 'бл+.дь', - 'трах', 'еб.+ть', 'ебу', 'ебал', '..ебен', 'ебан', 'ёбан', 'ебть', 'eby', '..ебись', 'уеб', 'уёб', 'ебей', + 'трах', 'еб.+ть', 'ебу', 'ебал', '..ебен', 'ебан', 'ёбан', 'ебть', 'eby', '..ебись', 'уеб', 'уёб', 'ебей', 'ебу', 'ебл', 'еба', + 'еб.+утые', 'е.+б.+утые', 'ебан', 'еб.+н', 'ебн', 'ёбн', + 'пр..ба', '.б.л', 'у.б', '.блан', 'п.+зда', 'пиз.+ец', 'пизд', 'пизец', 'пздец', 'п.+здец', 'пизд', 'пид.+р', 'пидр', 'д.лб.+б', @@ -72,6 +90,8 @@ def catch(message): bad_found = False for check in words: + # Mat -> Мат + check = rep(check) # -М#ат$ => Мат regex = compile('[^a-zA-Zа-яА-ЯЁё]') check = regex.sub('', check) @@ -79,9 +99,22 @@ def catch(message): break for bad in bad_list: if is_bad(check.lower(), bad, excepts) == True: - print(bad) + #print(bad) bad_found = True break + if not bad_found: + for check in words: + check = rep(check) + regex = compile('[^a-zA-Zа-яА-ЯЁё]') + check = regex.sub('.', check) + if bad_found: + break + for bad in bad_list: + if is_bad(check.lower(), bad, excepts) == True: + #print(bad) + bad_found = True + break + if bad_found: bot.delete_message(message.chat.id, message.id) @@ -96,7 +129,7 @@ def catch_edited_messages(message): catch(message) -#''' +''' while True: try: bot.polling() @@ -106,4 +139,4 @@ while True: pass ''' bot.polling() -''' +#'''