Как удалить конкретные клавиши в боте Телеграм?
Собственно сам код:
import telebot
from telebot import types
bot = telebot.TeleBot('api_code_name')
@bot.message_handler(commands=['start'])
def website(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True, row_width=1)
done = types.KeyboardButton('0')
undone = types.KeyboardButton('START')
markup.add(done, undone)
bot.send_message(message.chat.id, 'WHICH?:', reply_markup=markup)
@bot.message_handler(content_types=['text'])
def func(message):
if (message.text == "START"):
markup = types.ReplyKeyboardMarkup(resize_keyboard=True, row_width=3)
a = types.KeyboardButton('0')
b = types.KeyboardButton('SECOND')
markup.add(a, b)
bot.send_message(message.chat.id, 'WHICH ONE:', reply_markup=markup)
elif (message.text == "2"):
markup = types.InlineKeyboardMarkup()
button = types.InlineKeyboardButton('DATE', callback_data='None')
atom = types.InlineKeyboardButton('PHOTO', callback_data='None')
markup.add(button, atom)
bot.send_message(message.chat.id, '<b>!</b>', parse_mode="html", reply_markup=types.ReplyKeyboardRemove())
bot.polling(none_stop=True)
Каким образом можно сделать так, чтобы при выводе сообщения клавиши '0' и 'SECOND' исчезли из интерфейса, а Inline-кнопки 'DATE' и 'PHOTO' - остались?
Источник: Stack Overflow на русском