-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Add pagination to the output of the favorites list
command
#954
Add pagination to the output of the favorites list
command
#954
Conversation
Update Discord.js to version 14.11.0 to fix an error which occurred during implementation of this PR. (See: https://stackoverflow .com/questions/75892478/discord-js-v14-7-1-typeerror-channel-istextbased-is-not-a-function) Add Pagination.djs to project.
It's possible the favorites list may be very long. In the event this occurs, care must be taken when displaying the information as Discord imposes limits on the size of embeds (and more generally, messages). This implementation adds a library which makes paginating embeds easy so that the output of this command can handle an arbitrary amount of favorites. Furthermore, it switches the output to ephemeral to help prevent clutter in channels.
Not 100% sure if this PR constitutes a minor or patch bump... opted for minor since it introduces new functionality while also fixing a bug.
📦 A new release has been made for this pull request.To play around with this PR, pull Images are available for x86_64 and ARM64.
|
Signed-off-by: Cory J Reid <[email protected]>
Update Discord.js to version 14.11.0 to fix an error which occurred during implementation of this PR. (See: https://stackoverflow .com/questions/75892478/discord-js-v14-7-1-typeerror-channel-istextbased-is-not-a-function) Add Pagination.djs to project. Signed-off-by: Cory J Reid <[email protected]>
Signed-off-by: Cory J Reid <[email protected]>
It's possible the favorites list may be very long. In the event this occurs, care must be taken when displaying the information as Discord imposes limits on the size of embeds (and more generally, messages). This implementation adds a library which makes paginating embeds easy so that the output of this command can handle an arbitrary amount of favorites. Furthermore, it switches the output to ephemeral to help prevent clutter in channels. Signed-off-by: Cory J Reid <[email protected]>
Not 100% sure if this PR constitutes a minor or patch bump... opted for minor since it introduces new functionality while also fixing a bug. Signed-off-by: Cory J Reid <[email protected]>
…into favorites-list-with-pagination
I accidentally forgot to add the date when I made my addition.
The `yarn tsc` command was failing due to issues with project configuration and conflicting versions of @types/ws.
Alright, I got all the build checks passing! Sorry for the spam... I'm a Java developer typically so not super familiar with the Node/TS world. However it shows the merge is still blocked due to my first commits being unsigned (had never had a need to have that setup before). I'm not sure if you can simply override that on a case-by-case basis or if I should close this PR and open a new one? Please do let me know at your leisure (also if there's anything else I need to do/adjust)! Thanks! |
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.
tried it out and it looks awesome!
At the request of the repo owner.
🚀 Released in Release v2.4.0. |
Closes #606
Introduces pagination to the output of the
favorites list
command to prevent extremely large lists of favorites violating Discord's embed/message limits.Key Choices
I figured it would be easier to maintain by simply adding a package which provides the pagination rather than creating one myself.
I was encountering a bug when using the pagination library - turns out the bug was in Discord.js and upgrading resolved the issue. I updated and pinned to latest. (See: https://stackoverflow.com/questions/75892478/discord-js-v14-7-1-typeerror-channel-istextbased-is-not-a-function)
Note: Edits to the changelog might seem excessive... I simply formatted the file after making my additions to bring solid consistency. Can always undo this if this is an issue.