From 6d51cf135d45a2cf0f7bcdd9ce5fd99d671e4d3f Mon Sep 17 00:00:00 2001 From: vrubelroman Date: Wed, 3 Dec 2025 13:09:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=BB=D0=B5=20=D0=BD=D0=B5?= =?UTF-8?q?=D1=83=D0=B4=D0=B0=D1=87=D0=BD=D1=8B=D1=85=20=D0=BF=D0=BE=D0=BF?= =?UTF-8?q?=D1=8B=D1=82=D0=BE=D0=BA=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B8=D0=B3=D1=80=D0=BE=D0=BA=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B5=D0=B4=D0=BB=D0=B0=D0=B3=D0=B0=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20?= =?UTF-8?q?=D0=B8=D0=B3=D1=80=D0=BE=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LichessClientTG_bot/bot.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/LichessClientTG_bot/bot.py b/LichessClientTG_bot/bot.py index 88d1b93..1ce7e62 100644 --- a/LichessClientTG_bot/bot.py +++ b/LichessClientTG_bot/bot.py @@ -558,7 +558,8 @@ class LichessBot: user_exists = await self.lichess_api.check_user_exists(username) if not user_exists: await update.message.reply_text( - t('user_not_found', lang, username=username) + t('user_not_found', lang, username=username) + '\n\n' + t('addgamer_prompt', lang), + parse_mode='HTML' ) return WAITING_FOR_USERNAME @@ -569,13 +570,10 @@ class LichessBot: if existing_gamer: # Player is already being tracked by this user await update.message.reply_text( - t('gamer_already_added', lang, username=username) + t('gamer_already_added', lang, username=username) + '\n\n' + t('addgamer_prompt', lang), + parse_mode='HTML' ) - # Clear awaiting flag - try: - context.user_data['awaiting_addgamer_username'] = False - except Exception: - pass + # Keep awaiting flag - don't clear it, so user can try again return # Add gamer to database (without token) @@ -594,13 +592,10 @@ class LichessBot: # If add_user_gamer returned False, it means the pair already exists (shouldn't happen after our check, but just in case) if not added: await update.message.reply_text( - t('gamer_already_added', lang, username=username) + t('gamer_already_added', lang, username=username) + '\n\n' + t('addgamer_prompt', lang), + parse_mode='HTML' ) - # Clear awaiting flag - try: - context.user_data['awaiting_addgamer_username'] = False - except Exception: - pass + # Keep awaiting flag - don't clear it, so user can try again return # Set default period to 1 hour (60 minutes) for new gamer