Answer the question
In order to leave comments, you need to log in
How to update text?
Is it possible to update text in inline buttons?
I take the data from the database, and display it in the button, how can I update it when the data changes?
markup_inline = types.InlineKeyboardMarkup()
item1 = types.InlineKeyboardButton(text= 'Текст1 '+str(row[3]), callback_data= 'like1')
item2 = types.InlineKeyboardButton(text= 'Текст2 '+str(row[3]), callback_data= 'like2')
markup_inline.add(item1, item2)
Answer the question
In order to leave comments, you need to log in
You can call edit_message_reply_markup
the bot method by passing the necessary parameters.
edit_message_reply_markup(chat_id=None, message_id=None, inline_message_id=None, reply_markup=None):
"""
Use this method to edit only the reply markup of messages.
:param chat_id:
:param message_id:
:param inline_message_id:
:param reply_markup:
:return:
"""
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question