ygimenez / Pagination-Utils

A collection of methods to make message pagination with JDA easier.
GNU Lesser General Public License v2.1
27 stars 7 forks source link

Pagination doesn't work with custom emojis #14

Closed avurro closed 3 years ago

avurro commented 3 years ago
Paginator paginator = PaginatorBuilder.createPaginator().setHandler(jda)
     .shouldRemoveOnReact(false)
     .setEmote(Emote.SKIP_BACKWARD,":ss:807633784434327563")
     .setEmote(Emote.PREVIOUS,":s_:807633784521621534")
     .setEmote(Emote.SKIP_FORWARD,":dd:807633784580997130") 
     .setEmote(Emote.NEXT,":d_:807633784571822100")
     .build();

Result: image

With default emoji it works.

ygimenez commented 3 years ago

That's not how you use custom emojis, the correct mention will always be <:name:id> for static emotes and <:a:name:id> for animated emotes (this is a Discord thing, not a library's).

EDIT: in the case of the library, you must pass only the ID of the emote, omitting the name.

avurro commented 3 years ago

from javadoc: image Using format that you suggest i get the following error: java.lang.NumberFormatException: The specified ID is not a valid snowflake

ygimenez commented 3 years ago

Found the issue, it was previously only checking for emote names regardless of type, now it'll check for either name or ID depending on whether it's an emoji or Emote.

Please update to version 2.1.2.