Should I create multiple interaction handlers for each interaction type?

If I'm understanding correctly the point of the parse method is to determine whether a specific interaction handler should run, so that means we can create multiple handlers of the same type (Button for example) right? The guide does mention this is possible for listeners but doesn't say anything about it for interaction handlers so I just wanted to confirm, thanks!
Solution:
Yeah, you probably don't want the code to handle every type of button in the same handler. For instance, I have one handler that deals with buttons on polls, a separate handler that deals with confirm/deny buttons, and another one that just deals with dismissing & disabling message components.
Jump to solution
2 Replies
Solution
Ben
Ben2y ago
Yeah, you probably don't want the code to handle every type of button in the same handler. For instance, I have one handler that deals with buttons on polls, a separate handler that deals with confirm/deny buttons, and another one that just deals with dismissing & disabling message components.
Teixeira
Teixeira2y ago
Ok makes sense, thank you!
Want results from more Discord servers?
Add your server