Answer the question
In order to leave comments, you need to log in
How to return keyboard ReplyKeyboardMarkup?
In my code, after selecting the command with (ReplyKeyboardMarkup), I run a function in which I need to remove my main bot keyboard.
This is what I did with the command
markup = types.ReplyKeyboardRemove(selective=False)
Answer the question
In order to leave comments, you need to log in
ReplyKeyboardMarkup is added to SendMessage. It is necessary to send a message to the user with a keyboard.
The fact is that Telegram does not remember your keyboards and you cannot simply take and return the previous one. If the keyboard is static, then just save it as a global variable (this is not the best way, but it works and does not require overengineering) and send a message like "Function completed" with the keyboard after executing that function.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question