Answer the question
In order to leave comments, you need to log in
How to give individual buttons in the list different properties for telegram bot buttons?
There are 3 buttons
btn_film = KeyboardButton(text='Найти фильм')
btn_D = KeyboardButton(text='Математические операции')
btn_sql = KeyboardButton(text='Запись в БД')
markup_start = ReplyKeyboardMarkup(one_time_keyboard=True,resize_keyboard=True).add(btn_film).add(btn_D).add(btn_sql)
Answer the question
In order to leave comments, you need to log in
Look. As far as I know, this is not provided for in the constructor of the ReplyKeyboardMarkup class.
But you can take it into the processing of the logic of the button itself.
When a person clicks on a button (normal), he sends a text to the bot, which you catch using a handler decorator, for example, let's take the "Find movie" button:
@bot.message_handler(regexp = 'Найти фильм')
def find_film(message):
pass
@bot.message_handler(regexp = 'Найти фильм')
def find_film(message):
markup = telebot.types.ReplyKeyboardRemove()
bot.send_message(message.chat.id, 'remove keyboard', reply_markup=markup)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question