1
0

fix loop requesting seconds

This commit is contained in:
andrea
2025-07-26 22:41:24 +02:00
parent f8a3e12909
commit da0368d6c5
2 changed files with 6 additions and 0 deletions

4
bot.py
View File

@@ -15,6 +15,10 @@ from bot_libs import commands_handling as _bot_commands
async def bot_start(update, context): async def bot_start(update, context):
await update.message.reply_text(_botsyms.START_MSG) 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 = [ keyboard = [
['Init/Restart'], ['Init/Restart'],

View File

@@ -29,6 +29,8 @@ async def get_seconds_from_input(context, update, chat_id, text):
try: text= int(text) try: text= int(text)
except: return except: return
seconds= max(1, text) 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) return await _bot_repeat.start_loop_game(update, context, seconds)
### basic commands handling ### basic commands handling