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

Button Menu cannot react using emotes #98

Open
5 of 6 tasks
Artuto opened this issue Jan 9, 2020 · 4 comments
Open
5 of 6 tasks

Button Menu cannot react using emotes #98

Artuto opened this issue Jan 9, 2020 · 4 comments

Comments

@Artuto
Copy link

Artuto commented Jan 9, 2020

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.

The issue tracker is reserved for issues, errors, and feature requests related
to JDA-Utilities, and not questions and other requests for help.

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.

This issue tracker does not assist or handle issues with the JDA library.

For JDA related issues, visit the JDA issue tracker
and open an issue there.

Description

Using the Button Menu, when adding a choice you cannot use an emote if you have the EMOTE CacheFlag disabled.

The following code results in the following stack trace:

menuBuilder.addChoice("emote id here");
net.dv8tion.jda.api.exceptions.ErrorResponseException: 10014: Unknown Emoji
	at net.dv8tion.jda.api.exceptions.ErrorResponseException.create(ErrorResponseException.java:150)
	at net.dv8tion.jda.api.requests.Request.onFailure(Request.java:102)
	at net.dv8tion.jda.internal.requests.RestActionImpl.handleResponse(RestActionImpl.java:239)
	at net.dv8tion.jda.api.requests.Request.handleResponse(Request.java:197)
[...]

You can workaround this by doing this (adding the emote name to the id):

menuBuilder.addChoice("a:"+"emote id here");

However, when the add reaction event is received and handled by the menu, it compares the emote ID with the internal menu list of choices, which has a:emote id and not just the id, therefore the menu will never proceed

@Andre601
Copy link
Contributor

Andre601 commented Jan 9, 2020

Please refer to the Javadocs. They might be outdated, but I'm sure the ButtonMenu is still mostly up to date.

ButtonMenu.Builder#addChoice(String emoji)
image

@Artuto
Copy link
Author

Artuto commented Jan 9, 2020

Using the Button Menu, when adding a choice you cannot use an emote if you have the EMOTE CacheFlag disabled.

You cannot get a Emote object

@Andre601
Copy link
Contributor

Andre601 commented Jan 9, 2020

That is kinda obvious when you disable the CacheFlag for EMOTES, meaning JDA doesn't have it in its internal cache and therefore might first need to get it.

Just generate an Emote object to add to the list, or use Unicode emojis.

@Sanduhr32
Copy link

You know that you can literally use the format a?:name:id for emotes (if I recall the pattern correctly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants