Shared handler

How to make shared InteractionHandler to handle buttons and select menus together?
Solution:
you can export multiple classes in one file and sapphire will register them.
Jump to solution
4 Replies
ian
ian•2y ago
I believe you can't since the interactionType (or type i forgot) option for InteractionHandlerOptions is required, you might want to create 2 files in a folder within your interaction-handlers to organise your handlers.
Np 🌸
Np 🌸OP•2y ago
Oh but I needed this to reduce code duplicate as the way for handling them is same
Solution
ian
ian•2y ago
you can export multiple classes in one file and sapphire will register them.
ian
ian•2y ago
export class ButtonInteractionHandler extends InteractionHandler {}

export class SelectMenuInteractionHandler extends InteractionHandler {}
export class ButtonInteractionHandler extends InteractionHandler {}

export class SelectMenuInteractionHandler extends InteractionHandler {}
Want results from more Discord servers?
Add your server