I need to make a button generator using a database, here is an example on aiogram 2.0, how to do it on aiogram 3.0
def genmarkup(data):
builder = KeyboardBuilder(button_type=InlineKeyboardButton)
markup = InlineKeyboardMarkup(inline_keyboard=builder.export())
for i in data:
markup.add(InlineKeyboardButton(i[1], callback_data=i[2]))
return markup
You can try using the
InlineKeyboardMarkup
andInlineKeyboardButton
classes: