|
|
|
@ -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()
|
|
|
|
|
'''
|
|
|
|
|
#'''
|
|
|
|
|