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

Buttonization does not work with Pagination #13

Open
4 tasks done
xWink opened this issue Feb 6, 2021 · 3 comments
Open
4 tasks done

Buttonization does not work with Pagination #13

xWink opened this issue Feb 6, 2021 · 3 comments
Labels
delayed feature Feature will be added futurely enhancement New feature or request help wanted Extra attention is needed

Comments

@xWink
Copy link

xWink commented Feb 6, 2021

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:

  1. Create HashMap of buttons, as per buttonization guide
  2. Create ArrayList of Pages
  3. Populate ArrayList of Pages with Page objects with type EMBED and desired MessageEmbed instances, as per Pagination guide
  4. 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
  5. Start bot and make it display the paginated/buttonized message
  6. 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

image

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.

@ygimenez
Copy link
Owner

ygimenez commented Feb 7, 2021

I'll see what I can do, it'll probably be implemented as a different method in a future version.

@ygimenez ygimenez added the enhancement New feature or request label Feb 7, 2021
@avurro
Copy link

avurro commented Feb 8, 2021

What you think about to give the possibility to add emoji with custom function in paginate method ? @ygimenez

@ygimenez
Copy link
Owner

ygimenez commented Feb 9, 2021

This is what OP's talking about @avurro

@ygimenez ygimenez added the planned Feature has been considered label Feb 23, 2021
@ygimenez ygimenez added delayed feature Feature will be added futurely help wanted Extra attention is needed and removed planned Feature has been considered labels Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delayed feature Feature will be added futurely enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants