'How to remove a button from the telebot keyboard?

I need to remove the button from ReplyKeyboardMarkup. I search in Google very well. The telebot library(PyTelegramBotAPI) is used. Thank you in advance :)



Solution 1:[1]

Use telebot.types.ReplyKeyboardRemove to remove keyboard

from telebot.types import ReplyKeyboardRemove()
  
@bot.message_handler(func=lambda message:True)
def all_messages(message):
    if message.text:
        
        bot.send_message(message.from_user.id,"Done with Keyboard",reply_markup=ReplyKeyboardRemove())

bot.infinity_pooling()

Solution 2:[2]

You should use edit_message_reply_markup method to send a new set of buttons.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 itsAPK
Solution 2 Javad Zahiri