A
A
artgin2021-10-02 19:26:35
Python
artgin, 2021-10-02 19:26:35

Python (aiogram): When clicking on an inline button, how to send the contents of the button to the bot?

There is a list:

l = ['Яблоко', 'Груша']
keyboard = types.InlineKeyboardMarkup()
backbutton = types.InlineKeyboardButton(text="Back", callback_data="MainMenu")
button_list = [types.InlineKeyboardButton(text=x, callback_data=x) for x in l]
keyboard.add(*button_list, backbutton

which gives values ​​from the list to separate inline buttons, the problem is that when you click on the button, this value is not transferred back to the bot ... I read all the documentation on inline buttons, about callback query, etc. ... still nothing happens when you click , can someone tell me, on the shelf t.s. decompose?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question