Home python How to delete replykeyboardmarkup in telebot?

How to delete replykeyboardmarkup in telebot?

Author

Date

Category

how to delete replykeyboardmarkup after clicking?

Let’s take the code from step_example.py

...
...
...
def process_sex_step (message):
  try:
    chat_id = message.chat.id
    sex = message.text
    user = user_dict [chat_id]
    if (sex == u'Male ') or (sex == u'Female'):
      user.sex = sex
    else:
      raise Exception ()
    bot.send_message (chat_id, 'Nice to meet you' + user.name + '\ n Age:' + str (user.age) + '\ n Sex:' + user.sex)
  except Exception as e:
    bot.reply_to (message, 'oooops')

After we have selected the gender, how can we remove (not hide) the buttons until the next call / start and call the main menu using the function?


Answer 1, authority 100%

types.ReplyKeyboardRemove ()

pyTelegramBotAPI / examples / detailed_example / detailed_example.py string

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions