Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question