I am trying this for now, using python-telegram-bot==20.6
:
async def callback(update: Update, context: ContextTypes.DEFAULT_TYPE):
buttons = [
[InlineKeyboardButton(text="CONFIG", callback_data="CONFIG"), CANCEL_BUTTON]
]
keyboard = InlineKeyboardMarkup(buttons)
# remove normal markup
msg = await update.message.reply_text(text="Select an action", reply_markup=ReplyKeyboardRemove())
# add inline markup
await msg.edit_reply_markup(keyboard)
return SELECT_ACTION
What is strange here is I get error telegram.error.BadRequest: Message can't be edited
, where the message being edited is the one in the update, not msg
…