ygimenez/Pagination-Utils

custom reactions don't work

avurro opened this issue · 7 comments

Checklist

Make sure that you've checked all the items below.

  • Bot has the following permissions:
    • 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
  • If using .setRemoveOnReact(true), you have the following permission:
    • MESSAGE_MANAGE
  • 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 X.XXX
  • PaginationUtils version X.XXX

Describe the bug

Everything works perfectly if I use the standard arrows. But if I set custom emoji it doesn't work.

To Reproduce

set custom emojis, for example:
Paginator paginator = PaginatorBuilder.createPaginator().setHandler(jda)
.shouldRemoveOnReact(true)
.setEmote(Emote.GOTO_FIRST,"<:first:809233195354685480>")
.setEmote(Emote.PREVIOUS,"<:previous:809233195303436298>")
.setEmote(Emote.GOTO_LAST,"<:last:809233195181670410>")
.setEmote(Emote.NEXT,"<:next:809233195136188467>")
.setEmote(Emote.CANCEL, "<:cancel:809239881002909737>")

Expected behavior

the same behavior as with standard arrows

In Paginator class you use:
private Map<Emote, Emoji> emotes = new EnumMap<>(Emote.class);

But in Pages class you use:
com.github.ygimenez.type.EMOTE

If my analysis is correct it's sufficient to retrieve the emojis from Paginator.

What error do you get?

No errors. Nothing happens when you click the emojis.

Thanks, that helps a bit when debugging.

Not to put pressure on, but I need the library up and running in a short time. If you need a couple of days no problem, otherwise I use older versions (which unfortunately require code changes).

I'll not be able to work on it this weekend (not at home), but I'll fix it as soon as possible.

You could meanwhile use default emotes or see if the it works in the alternative mode (reactions or interactions, depending on what you're currently using) since it's designed to require minimum refactoring to switch between the two (just changing from Page to InteractPage and setting useButtons to true on the methods).

Issue fixed in release 3.0.7