Add new ban rules

This commit is contained in:
Rykov7
2023-09-02 19:06:37 +03:00
parent 7a3c78d813
commit 3248bb6842
7 changed files with 121 additions and 37 deletions
+2 -3
View File
@@ -7,12 +7,11 @@ def in_spam_list(message: types.Message) -> bool:
"""Check for mentioning unwanted persons in text."""
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:
for url in SPAM:
if url in message.text.casefold():
for text in SPAM:
if text in message.text.casefold():
logging.info(
"!BAN!" + LOG_COMM % (
message.chat.title, message.from_user.id, message.from_user.first_name, message.text))
return True