You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Paginator class already exists in matrix/help/pagination.py and is used internally by the help command. It is not exported from the public API and provides no way to send pages to a room with reaction-based navigation, it only slices lists into Page objects.
The idea is to make Paginator a first-class public utility and extend it with a send method that posts the first page and handles ⬅️ / ➡️ reactions to let users navigate, making it straightforward to paginate any long output from a command.
The existing Paginator and Page classes handle slicing correctly already; the work is adding the interactive layer. send would post the first page, add navigation reactions, then use wait_for (see related issue) to listen for reactions from the original sender and update the message in place. Editing a Matrix message uses the m.replace relationship type. The main question is whether to edit in place or post new messages per page, editing is cleaner but requires the bot to have the original event ID; posting new messages is simpler but noisy. Also worth exporting Paginator and Page from matrix/__init__.py.
Activity
wait_for#97