Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create examle3.py use aiogram #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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