update logging

This commit is contained in:
Rykov7
2023-04-13 13:25:59 +03:00
parent b7ed7bc45d
commit f6fda1b355
4 changed files with 118 additions and 28 deletions
+8 -2
View File
@@ -9,13 +9,19 @@ def in_spam_list(message: types.Message) -> bool:
if message.from_user.id not in WHITEIDS and antispam_is_enabled:
for url in SPAM:
if url in message.text.casefold():
logging.info(
"!BAN!" + LOG_TEXT % (
message.chat.title, message.from_user.id, message.from_user.first_name, message.text))
return True
def in_caption_spam_list(type_message: types.Message) -> bool:
def in_caption_spam_list(message: types.Message) -> bool:
"""Check for mentioning unwanted words in caption."""
for phrase in BAN_WORDS:
if type_message.caption and phrase in type_message.caption:
if message.caption and phrase in message.caption:
logging.info("!BAN!" + LOG_TEXT % (
message.chat.title, message.from_user.id, message.from_user.first_name, message.video.file_name))
return True