Answer the question
In order to leave comments, you need to log in
How in a telegram bot, after pressing the Inline button, wait for a response from the user?
I am making a bot on python-telegram-bot. Made an inline keyboard. When you click on the button, the bot displays a message with a list of cases and prompts you to select a case number. How can I make it wait for a response from the user?
Here is the part of the code that fires the button when clicked
if data == CALLBACK_BUTTON1_START:
choose_list = print_jobs_list(update=update, context=context)
context.bot.send_message(chat_id=chat_id, text=f"Выберите номер этапа работы?\n{choose_list}")
Answer the question
In order to leave comments, you need to log in
I will do this through the ConversationHandler conversation handler.
dialog_handler = ConversationHandler(
entry_points=[
CommandHandler('some_command', callback)
],
states={
'buttons':[
CallbackQueryHandler(callback)
],
'job_selection':[
MessageHandler(FIlters.text, callback)
],
},
fallbacks=[
CommandHandler('cancel', cancel)
]
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question