At the moment I have a task to show the keyboard to the bot telegrams, and then - after pressing the "/ stop" button - to remove it. I wrote this code:

@bot.message_handler(commands=["start"]) def start(message): bot.send_message(message.chat.id, config.LIST) user_markup = telebot.types.ReplyKeyboardMarkup(True, False) user_markup.row("/start","/stop") user_markup.row("bt1","bt2") bot.send_message(message.from_user.id, "Добро пожаловать.." , reply_markup=user_markup) @bot.message_handler(commands=["stop"]) def stop(message): hide_markup = telebot.types.ReplyKeyboardHide() bot.send_message(message.from_user.id, reply_markup=hide_markup) 

After starting the console, the error "AttributeError: module 'telebot.types' has no attribute 'ReplyKeyboardHide'" is issued. I went to the Bot API telegram documentation and, like, did everything as it is written there. What is the problem and how to fix it?

  • The object is called ReplyKeyboardRemove . - mymedia
  • Thanks, apparently I didn’t look good - Howuhh

2 answers 2

after creating the keyboard, add this variable and the keyboard will disappear after pressing the button

 user_markup.one_time_keyboard = True 
     hide_markup = telebot.types.ReplyKeyboardRemove() 

    The code has apparently changed since then. Works, if correct for the above written.