Make events consumable #2387
JustRed23
started this conversation in
Feedback & Suggestions
Replies: 2 comments
-
Because that would result in a massive amount of memory allocations. You are creating a new listener every single time you create a button. Also, the event system in JDA is pluggable, and we cannot provide a consistent way to do this on buttons with the different event systems. Additionally, buttons are created using static factory methods that do not have any access to the gateway context. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Interesting, thanks |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to add a feature that adds consumable events. We have an event listener and we can process all events there but why not in the Button itself?
Ex.
Button.primary("buttonid:dostuff", "Do stuff").onEvent(buttonInteractionEvent -> buttonInteractionEvent.getChannel().sendMessage("Hello world!").queue())
You could still listen for the events but they could get handled like this as well
Beta Was this translation helpful? Give feedback.
All reactions