From da0368d6c5a27fa62cacd2f802745a4f4d9bd44c73f0b834359a40dcc782f002 Mon Sep 17 00:00:00 2001 From: andrea Date: Sat, 26 Jul 2025 22:41:24 +0200 Subject: [PATCH] fix loop requesting seconds --- bot.py | 4 ++++ bot_libs/commands_handling.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/bot.py b/bot.py index 02bcec6..11bc616 100644 --- a/bot.py +++ b/bot.py @@ -15,6 +15,10 @@ from bot_libs import commands_handling as _bot_commands async def bot_start(update, context): await update.message.reply_text(_botsyms.START_MSG) + if 'ask_name' in context.application.bot_data: + del(context.application.bot_data['ask_name']) + if 'ask_seconds' in context.application.bot_data: + del(context.application.bot_data['ask_seconds']) keyboard = [ ['Init/Restart'], diff --git a/bot_libs/commands_handling.py b/bot_libs/commands_handling.py index e3bfff7..e0f6e3a 100644 --- a/bot_libs/commands_handling.py +++ b/bot_libs/commands_handling.py @@ -29,6 +29,8 @@ async def get_seconds_from_input(context, update, chat_id, text): try: text= int(text) except: return seconds= max(1, text) + if 'ask_seconds' in context.application.bot_data: + del(context.application.bot_data['ask_seconds']) return await _bot_repeat.start_loop_game(update, context, seconds) ### basic commands handling