In python telegram bot, is it possible for an InlineKeyboardButton to send a command like /cancel when it is pressed?
For example, when the user presses the cancel button, they will automatically send a /cancel command that will then be processed by the bot.
From the example here:
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinekeyboard2.py
conv_handler = ConversationHandler(
entry_points=[CommandHandler('start', start)],
states={
FIRST: [CallbackQueryHandler(one, pattern='^' + str(ONE) + '$'),
CallbackQueryHandler(two, pattern='^' + str(TWO) + '$'),
CallbackQueryHandler(three, pattern='^' + str(THREE) + '$'),
CallbackQueryHandler(four, pattern='^' + str(FOUR) + '$')],
SECOND: [CallbackQueryHandler(start_over, pattern='^' + str(ONE) + '$'),
CallbackQueryHandler(end, pattern='^' + str(TWO) + '$')]
},
fallbacks=[CommandHandler('start', start)]
)
I would like to be able to do this so that I can change my entry point and use a different conversation handler upon button press.
Pressing the button would then generate a /cancel command that would bring the bot to a different conversation handler.
Is this possible?