ksinn / python-telegram-bot-pagination

Python inline keyboard pagination for Telegram Bot API
Other
105 stars 23 forks source link

Create InlineKeyboardSimplePaginator and add example for it #5

Open poteminr opened 2 years ago

poteminr commented 2 years ago

I created a new type of Paginator: InlineKeyboardSimplePaginator. It can be used for turning pages in a circle.

Basic InlineKeyboardPaginator is too complex for creating a small app where we need to go through pages and not think about other pages, their numbers. (for example, a list of university assignments for Tuesday).

Format of keyboard (three buttons) : ‹‹ {current_page}/{page_count} ›› e.g. ‹‹ 11/15 ››

Later I can extend the functionality of InlineKeyboardSimplePaginator.

So I customised InlineKeyboardPaginator for my project and decided to make a PR. It can be useful for other users.

ksinn commented 2 years ago

Thank you for sharing your pagination. I'll gladly accept your pull request if you make a few changes.

  1. I noticed that the InlineKeyboardSimplePaginator is made as a copy of the InlineKeyboardPaginator with the necessary methods changed. It would be better to fix on inheritance with overriding;
  2. Please, for the convenience of other users, in addition to an example, add a description and screenshots for InlineKeyboardSimplePaginator to README.md.
poteminr commented 2 years ago

Sounds reasonable. I'm going to do it :)

poteminr commented 2 years ago

@ksinn New images from README.md will be available after uploading on examples/media folder.

poteminr commented 2 years ago

@ksinn What about Pull Request?