From e9dae8be2e109ae58837d3b82b150f79f3cc53db Mon Sep 17 00:00:00 2001 From: J-Rios Date: Thu, 20 Oct 2022 16:24:56 +0200 Subject: [PATCH] Fix num joins counter clear before Ban --- sources/join_captcha_bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/join_captcha_bot.py b/sources/join_captcha_bot.py index 87636e1..948a615 100644 --- a/sources/join_captcha_bot.py +++ b/sources/join_captcha_bot.py @@ -667,7 +667,8 @@ def captcha_fail_kick_ban_member(bot, chat_id, user_id, max_join_retries): msg_text = TEXT[lang]["NEW_USER_KICK"].format(user_name) # Increase join retries join_retries = join_retries + 1 - printts("[{}] Increased join_retries to {}".format(chat_id, join_retries)) + printts("[{}] [{}] Increased join_retries to {}".format( + chat_id, user_id, join_retries)) # Send kicked message if rm_result_msg: tlg_send_selfdestruct_msg_in(bot, chat_id, msg_text, CONST["T_FAST_DEL_MSG"]) @@ -706,6 +707,8 @@ def captcha_fail_kick_ban_member(bot, chat_id, user_id, max_join_retries): # Ban success msg_text = TEXT[lang]["NEW_USER_BAN"].format( user_name, max_join_retries) + # Delete user join info if ban was success + del new_users[chat_id][user_id] else: # Ban fail if ban_result["error"] == "User not found": @@ -740,9 +743,6 @@ def captcha_fail_kick_ban_member(bot, chat_id, user_id, max_join_retries): for msg in new_users[chat_id][user_id]["msg_to_rm_on_kick"]: tlg_delete_msg(bot, chat_id, msg) new_users[chat_id][user_id]["msg_to_rm_on_kick"].clear() - # Delete user join info if was ban - if join_retries >= 5: - del new_users[chat_id][user_id] printts("[{}] Kick/Ban process completed".format(chat_id)) printts(" ")