Chew / JDA-Chewtils

Chew's fork of JDA-Applications/JDA-Utilities, with support for modern features such as Slash Commands, Context Menus, and more.

Home Page:https://chew.pro/JDA-Chewtils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Suggestion] Include support for Discord's buttons for pagination

Andre601 opened this issue · 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.

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

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.
  • This is a feature request for the JDA-Utilities library.

Description

It would be a real nice addition to have direct support for Discord's buttons in the navigation of Pagination.

Current downsides I can see are as follows:

  • Would (currently) use the feature/slash-command branch of JDA since Button support isn't officially released into JDA yet.
  • Button handling could become more difficult in terms of resolving message and current state (what "page" is displayed) but I assume this is similar complication/effort as the reaction-system and could perhaps be simplified/combined into a single manager to handle it.
  • The code in general is a big pile of 💩... I know it, since I tried myself to implement button support.

Unironically may just be the best maneuver to deprecate all the classes and make our own 😂 I never realized how many paginators there were and it's kinda annoying. They could easily be merged

Unironically may just be the best maneuver to deprecate all the classes and make our own 😂 I never realized how many paginators there were and it's kinda annoying. They could easily be merged

Agree.
A central PaginatorUtil (or something like that) which handles reaction/button clicking and perhaps even pagination creation (Considering that all menus/paginators so far use embeds) itself would allow to reduce a lot of duplicate code and make stuff less bloated.

One current problem I see right now is, that the Utils uses a RestAction<Message> to directly get the Message info from a sendMessage or editMessage Action. This allows it to have checks like the message ID and such in its waitForEvent.
With buttons would we - at least for sendMessage - require a way to get the ID and implement it into the buttons, or find a more generic button ID setup and some logic behind it....