wiltonsr / ptb-pagination

Python inline keyboard pagination for Telegram Bot API

Home Page:https://pypi.org/project/ptb-pagination/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ptb-pagination

Python inline keyboard pagination for Telegram Bot API.

Provide an easy way to create number pagination with Telegram Inline Keyboards for python-telegram-bot.

Telegram Pagination Docs Example

This project is very based on python-telegram-bot-pagination, thanks ksinn.

The main difference it's supposed to only work with the python-telegram-bot library and provide full support to Arbitrary callback_data.

Installation

pip install ptb-pagination

Usage

from ptb_pagination import InlineKeyboardPaginator

paginator = InlineKeyboardPaginator(
    page_count,
    current_page=page,
    data_pattern='page#{page}'
)

bot.send_message(
    chat_id,
    text,
    reply_markup=paginator.markup,
)

About

Python inline keyboard pagination for Telegram Bot API

https://pypi.org/project/ptb-pagination/

License:MIT License


Languages

Language:Python 100.0%