JDA-Utilities icon indicating copy to clipboard operation
JDA-Utilities copied to clipboard

Add support to directly add MessageEmbeds to Paginator

Open Andre601 opened this issue 4 years ago • 6 comments

Issue

Issue Checklist

Please follow the following steps before opening this issue.
Issues that do not complete the checklist may be closed without any help.

  • [x] I have checked for similar issues on the issue tracker.
  • [x] I have updated to the latest version of JDA-Utilities.
  • [x] I have checked the branches or the maintainers' PRs for upcoming features/bug fixes.

The issue tracker is reserved for issues, errors, and feature requests related to JDA-Utilities, and not questions and other requests for help.

Issue Information

Check all that apply:

  • [ ] This is a bug report about an error, issue, or bug in JDA-Utilities.
    • [ ] I have been able to consistently reproduce this bug.
  • [x] This is a feature request for the JDA-Utilities library.

This issue tracker does not assist or handle issues with the JDA library.
For JDA related issues, visit the JDA issue tracker and open an issue there.

Description

The paginator, while nice to use, is limited in how much you can customize it. In fact, other than changing, if the page number should be shown in the footer, the color and the actual description itself is the Paginator not that customizable, considering it using embeds.

My suggestion is to implement support, to directly provide MessageEmbed(s) through a addItems(MessageEmbed...) method.

Why do I not implement it? The current code of the Paginator is way too strict and complicated, as that it would allow to directly add MessageEmbeds without an entire recode (Unless you guys know a proper way). I wanted to implement it myself, but it's just way too much and would result on an entire recode on my end, which is not what I want to achieve here, as this would also be a difficult part in a PR.

Andre601 avatar Mar 25 '20 19:03 Andre601

This sounds like it should be a new menu type

jagrosh avatar Mar 25 '20 19:03 jagrosh

I mean sure, but why exactly? I can see many people to want this functionality in the Paginator itself to f.e. show more detailed command-lists with like thumbnails or custom colours...

Andre601 avatar Mar 25 '20 19:03 Andre601

The primary purpose of the paginator is to split up the items into the appropriate-sized lists automatically, provide page numbers, etc.... supplying your own embeds prevents it from doing any of this. If you're supplying your own embeds, there's no paginator functionality anymore, just the general menu functionality of press-reaction->change-view.

jagrosh avatar Mar 25 '20 19:03 jagrosh

Providing a custom embed is actually much closer functionality to the Slideshow than to the Paginator

jagrosh avatar Mar 25 '20 19:03 jagrosh

Considering this, did I now try my best to create a EmbedPaginator class for achieving this goal. I made a PR on my fork so that you guys can take a look.

Andre601 avatar Mar 25 '20 21:03 Andre601

I made some basic testing with it and it seems to work without errors or issues.

Andre601 avatar Mar 25 '20 23:03 Andre601