Add ban words

This commit is contained in:
Rykov7
2023-09-02 19:51:56 +03:00
parent 3e0ae2e076
commit b83ccfab85
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ def disable_stan(message: types.Message):
@bot.message_handler( @bot.message_handler(
func=is_white, func=is_white,
commands=["set_antispam_report_reminder"], commands=["set_antispam_report_reminder", "set_rules"],
chat_types=["supergroup", "group"], chat_types=["supergroup", "group"],
) )
def set_antispam_report_reminder(message: types.Message): def set_antispam_report_reminder(message: types.Message):
+1 -1
View File
@@ -8,7 +8,7 @@ def in_spam_list(message: types.Message) -> bool:
antispam_is_enabled = session.query(Chat.antispam).filter_by(chat_id=message.chat.id).first()[0] antispam_is_enabled = session.query(Chat.antispam).filter_by(chat_id=message.chat.id).first()[0]
if message.from_user.id not in WHITEIDS and antispam_is_enabled: if message.from_user.id not in WHITEIDS and antispam_is_enabled:
for text in SPAM: for text in SPAM:
if text in message.text.casefold(): if text.casefold() in message.text.casefold():
logging.info( logging.info(
"!BAN!" + LOG_COMM % ( "!BAN!" + LOG_COMM % (
message.chat.title, message.from_user.id, message.from_user.first_name, message.text)) message.chat.title, message.from_user.id, message.from_user.first_name, message.text))