-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
[ext.pages] General fixes and enhancements #1227
Conversation
… edit the message (used by default), otherwise fall back to message attr edit path adds `custom_view` parameter to `Page` object, which overrides the custom view for the paginator when that page is being shown to better accommodate the above item, a new method `update_custom_view` has been added which will change the `custom_view` of a paginator when called. various other docstring fixes and cleanup
Added |
Moving to draft status while I work on polishing a couple of the newer items added. |
…action()` add `Paginator.trigger_on_display` (and corresponding `PageGroup`) parameter, which will automatically fire the callback for a `Page` whenever that page is displayed.
…page_count` as -1
This is ready for review (again). Slight breaking change introduced by the removal of a return value for |
LGTM for me. Not approving tho |
Summary
This PR makes the following changes:
Paginator.update_custom_view()
- New method used to easily change the custom view shown with the paginator without needing to usePaginator.update()
to do so.Page.custom_view
- New parameter, represents a custom view assigned to aPage
object, which will be displayed when that page is being displayed. Overrides any definedPaginator.custom_view
while the page is being displayed.Paginator.goto_page()
now accepts a keyword argumentinteraction
. If provided, the message associated to the paginator will be edited via that interaction's response path. If not, thediscord.Message
object assigned toPaginator.message
will be used to edit the message instead.PaginatorButton
now passes itsinteraction
automatically to itsPaginator.goto_page()
call by default.Page.callback()
method, which can be used to assign a callback to a specific page.Paginator.page_action()
method which triggers the callback of the currently displayed page, if one is defined.Paginator.trigger_on_display
parameter which makesgoto_page
automatically callPaginator.page_action()
whenever aPage
with a defined callback is displayed.Checklist
type: ignore
comments were used, a comment is also left explaining why