Skip to content

Commit f03cefa

Browse files
committed
Fix order of answering callback query
1 parent 5c8c757 commit f03cefa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

StringSessionBot/callbacks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,20 @@ async def _callbacks(bot: Client, callback_query: CallbackQuery):
4646
await callback_query.answer()
4747
await callback_query.message.reply(ask_ques, reply_markup=InlineKeyboardMarkup(buttons_ques))
4848
elif query.startswith("pyrogram") or query.startswith("telethon"):
49-
await callback_query.answer()
5049
try:
5150
if query == "pyrogram":
52-
await callback_query.answer("Please note that the new type of string sessions may not work in all bots, i.e, only the bots that have been updated to pyrogram v2 will work!")
51+
await callback_query.answer("Please note that the new type of string sessions may not work in all bots, i.e, only the bots that have been updated to pyrogram v2 will work!", show_alert=True)
5352
await generate_session(bot, callback_query.message)
5453
elif query == "pyrogram1":
54+
await callback_query.answer()
5555
await generate_session(bot, callback_query.message, old_pyro=True)
5656
# elif query == "pyrogram_bot":
57-
# await callback_query.answer("Please note that this bot session will be of pyrogram v2")
57+
# await callback_query.answer("Please note that this bot session will be of pyrogram v2", show_alert=True)
5858
# await generate_session(bot, callback_query.message, is_bot=True)
5959
# elif query == "telethon_bot":
6060
# await generate_session(bot, callback_query.message, telethon=True, is_bot=True)
6161
elif query == "telethon":
62+
await callback_query.answer()
6263
await generate_session(bot, callback_query.message, telethon=True)
6364
except Exception as e:
6465
print(traceback.format_exc())

0 commit comments

Comments
 (0)