-
Notifications
You must be signed in to change notification settings - Fork 18
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
401 add pagination helper #527
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sagarpatel211 Looks really good. My only issue with this is that the buttons tend to disappear after a while, leaving the embed stuck on a particular page.
Is there a way to fix this?
@probro27 if we want to avoid memory leaks we cannot keep the buttons around forever (except in cases where the page can be generated from the page number without needing to store the embeds in RAM, but that seems like a future enhancement). maybe to improve the intentionality we can disable the buttons before quitting the listener so it's more obvious that it was paginated and it was intentionally disabled, but that's an aesthetic decision |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sagarpatel211 Based on the comment by Alex, the only thing we need to add is a new function that overloads the existing one, except it takes the entire text or leaderboard data and divides it into pages itself.
We can keep the current function which is useful for specific page data.
Thanks!
New changes include:
Let me know if there's more suggestions. If not, after removing the pagination-test command it can be merged. |
Only the user who invokes the pagination should be able to see the buttons to change pages. Right now, pressing the buttons as an "outside" user results in a "This interaction failed" message. |
Summary of Changes
Motivation and Explanation
Related Issues
Steps to Reproduce
.pg
,.pagination
, or.pgtest
in your test channel to try out an example pagination I wroteDemonstration of Changes
src/commands/miscellaneous/pagination-test.ts
andsrc/commandDetails/miscellaneous/pagination-test.ts
, which can be removed.Further Information and Comments