From f97307527b2a2f7b96454addb4e4545ccb17491b Mon Sep 17 00:00:00 2001 From: Luca Lombardo Date: Wed, 17 Jan 2024 12:53:50 +0100 Subject: [PATCH] Update button click handling in bot.py --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 733db0a..2bb6f7d 100644 --- a/bot.py +++ b/bot.py @@ -33,7 +33,7 @@ buttons = { # {name of the button: courses} # Handle button click @bot.callback_query_handler(func=lambda call: call.data == 'authenticate') async def handle_authenticate(call): - await bot.answer_callback_query(call.id) # Answer the callback query + await bot.answer_callback_query(call.id, text="Autenticazione completata") # Avoids to leave the button pressed and sends a message on screen (not in chat) if is_mathematician(call.from_user.id): markup = types.InlineKeyboardMarkup() @@ -48,7 +48,7 @@ async def handle_authenticate(call): # Handle button click @bot.callback_query_handler(func=lambda call: call.data in buttons) async def handle_buttons(call): - await bot.answer_callback_query(call.id) + await bot.answer_callback_query(call.id) # Avoids to leave the button pressed, no message is sent on screen await bot.send_message(call.message.chat.id, buttons[call.data]) asyncio.run(bot.polling()) \ No newline at end of file