Buttonization does not work with Pagination
xWink opened this issue · 3 comments
Checklist
Make sure that you've checked all the items below.
- Bot has the following permissions:
- MESSAGE_MANAGE
- MESSAGE_ADD_REACTION
- MESSAGE_EXT_EMOJI
- MESSAGE_READ/WRITE
- VIEW_CHANNEL
- If using
JDABuilder.createLight()
, you added the following gateway intents:- GUILD_MESSAGES
- GUILD_MESSAGE_REACTIONS
- PaginationUtils is up-to-date.
- You have activated the library as descripted in the README.
Library info
What libraries versions are you using.
- JDA version 4.1.1_165
- PaginationUtils version 2.1.1
Describe the bug
Using the library to paginate AND buttonize a MessageEmbed will result in all the reactions being added, but only the functionality of one (pagination OR buttonization). The functioning feature is determined by the order in which they are declared, so if one were to paginate and then buttonize a message, the functionality of buttonization would work, but not pagination, despite all the reactions being added to the message. Inverting the order of pagination/buttonization makes pagination work and buttonization fail (but all reactions are still added).
To Reproduce
Steps to reproduce the behavior:
- Create HashMap of buttons, as per buttonization guide
- Create ArrayList of Pages
- Populate ArrayList of Pages with Page objects with type EMBED and desired MessageEmbed instances, as per Pagination guide
- Send message where the content is the content of the first page in the ArrayList (casted as MessageEmbed) and pass a callback to the queue method to buttonize and paginate the successfully sent message, as per Buttonization and Pagination guides
- Start bot and make it display the paginated/buttonized message
- Try to navigate resulting menu and use the additional buttons, only one feature will work
Expected behavior
Functionality of both pagination and buttonization should work such that a MessageEmbed can be sent with a list of options with pages. This will allow for numbered lists with more than 10 options to exist (via pagination) while also being easy to use.
Screenshots
Additional context
This is particularly useful for the case of ordered lists of options. In my case, it would be to show a list of 12 numbered/lettered options in groups of 5. So the first page would show 5 options, with reactions for numbers 1-5 (or letters A-E) as well as the pagination reactions. The second page shows the next 5 options with the same buttons as the first page. The third page shows the last 2 options, so only reactions for numbers 1-2, but also with pagination reactions.
I'll see what I can do, it'll probably be implemented as a different method in a future version.