From cc72f12470befef967f666769df838a9ebb90f80 Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Sun, 28 Jan 2024 10:24:17 +0300 Subject: [PATCH] Fix bug with checking empty Bio. --- src/reminder.py | 2 +- src/stan.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reminder.py b/src/reminder.py index 3591abe..cb5f100 100644 --- a/src/reminder.py +++ b/src/reminder.py @@ -13,7 +13,7 @@ from .constants import PYTHONCHATRU from .report import create_report_text, reset_report_stats if USE_REMINDER: - logging.debug("Starts reminder!!!") + logging.debug("[START] Reminder") # We need synchronous instance of bot here as we use synchronous library 'schedule' in a separate thread. bot = TeleBot(TOKEN, "HTML", disable_web_page_preview=True, allow_sending_without_reply=True) else: diff --git a/src/stan.py b/src/stan.py index 88464df..4f4d303 100644 --- a/src/stan.py +++ b/src/stan.py @@ -98,7 +98,7 @@ async def check_new_members(message: types.Message): info['bio'] = more_data.bio if more_data.photo: info['photo'] = more_data.photo.big_file_id - if has_links(info['bio']): + if info['bio'] and has_links(info['bio']): await bot.ban_chat_member(message.chat.id, info['id']) logging.info(f"[BANNED] User {info['full_name']} has url in bio: {info['bio']}") else: