Closed Nick-kel closed 3 years ago
That's because each message must have only one button listener attached to at any time.
To use multiple buttons on buttonize
method, use a normal Map
instead of a singleton, like the example below:
Map<String, BiConsumer<Message, User>> buttons = new HashMap(){{
put("❌", deny);
put("✅", accept);
}};
Pages.buttonize(success, buttons, false, 120, TimeUnit.SECONDS);
Checklist
JDABuilder.createLight()
, you added the following gateway intents:.setRemoveOnReact(true)
, you have the following permission:Library info
Describe the bug If I add two bottuns in the success consumer of a message, the first button does not execute the consumer when reacting:
In this example, nothing happens when reacting with ❌. I also switched the order of the code lines and then the ✅ reaction didn't work.