Skip to content
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

Merged

Conversation

coryjreid
Copy link
Contributor

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.

  • I updated the changelog

Key Choices

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.

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.
@github-actions
Copy link

github-actions bot commented Jul 16, 2023

📦 A new release has been made for this pull request.

To play around with this PR, pull codetheweb/muse:pr-954 or codetheweb/muse:23b15bdbd093755cfc062f5ea7bac1ac4ceea2a7.

Images are available for x86_64 and ARM64.

Latest commit: 23b15bd

codetheweb and others added 8 commits July 15, 2023 19:50
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]>
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]>
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.
@coryjreid
Copy link
Contributor Author

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!

Copy link
Collaborator

@codetheweb codetheweb left a 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!

tsconfig.json Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@codetheweb codetheweb merged commit 9c6d2a7 into museofficial:master Jul 20, 2023
5 checks passed
@github-actions
Copy link

🚀 Released in Release v2.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem - Favorites
2 participants