Skip to content

Conversation

macros0
Copy link

@macros0 macros0 commented Dec 4, 2022

Create examle3.py use aiogram

Create examle3.py use aiogram
@gulyaeve
Copy link

To work with aiogram 3.x version i added this function to convert paginator.markup to inline keyboard:

def make_inline_keyboard(markup):
    markup = json.loads(markup)['inline_keyboard']

    rows = []
    for row in markup:
        buttons = []
        for button in row:
            buttons.append(types.InlineKeyboardButton(text=button['text'], callback_data=button['callback_data']))
        rows.append(buttons)

    keyboard = types.InlineKeyboardMarkup(inline_keyboard=rows)
    return keyboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants