#Need to catch the button event
1 messages · Page 1 of 1 (latest)
<@&987246924425994290> please have a look, thanks.
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
its not a slash command though, is it?
implement the UserInteractor interface instead
there are a hand full of examples in the code base as well
ah oki, i just searched for onButtonClick and found this one😅
and it has to be the class who also created the button
oki so in same class
the magic wiring is in the ID that u attach to the button when u create it
which contains the name of the class
generateComponentId() or whatever it was called
so when the button is clicked, our code searches for the class with that name and forwards it to there
which class is it btw? perhaps it's already an UserInteractor
HelpSystemHelper
well
that won't work then
its a helper. it's not supposed to create and handle buttons
only to offer some slim static helper methods
rip
i was able to create a button tho, i was trynna find a way to handle that interaction
u can't. ull never receive the event
how were u even able to create a button with a component id
if ur not a userinteractor, u don't have the generate method
ah. u added a selfmade id
well yeah. that ain't work at all
that's not how our system works
ah i looked up a quick example from jda docs😅
the event when clicked reaches our bot and it fails to parse it and forward it
yes we have a custom system
u should consult our wiki instead
but that button stuff can't happen in the helper
perhaps that entire code is becoming already too big for a helper
and should be moved
prolly it does seem like a bit too much
yeah. sorry
no i meant the helper file seems a bit large, so you might be right about "too big for helper" thingy
indeed