InteractionHandler

Im kinda new to discord.js so im abit confused on how to make it so that only the command author can use the select menu in interaction handlers
Solution:
Pass the command author id through with the customId field (alongside some kind of identifying information) then validate it and return some/none accordingly. View the sapphire guide on interaction handlers for more info on the latter. https://www.sapphirejs.dev/docs/Guide/interaction-handlers/what-are-they Mind you that customId is limited to 100 characters. If the data you need to pass doesn't fit into that when stringified you'll need to do some compression, for example for @Dragonite I have this https://github.com/favware/dragonite/blob/main/src/lib/util/utils.ts...
Sapphire Framework
What are they? | Sapphire
These are interaction handlers! A simple class you can extend to handle almost all the interactions you may receive in
Jump to solution
2 Replies
Solution
Favna
Favna12mo ago
Pass the command author id through with the customId field (alongside some kind of identifying information) then validate it and return some/none accordingly. View the sapphire guide on interaction handlers for more info on the latter. https://www.sapphirejs.dev/docs/Guide/interaction-handlers/what-are-they Mind you that customId is limited to 100 characters. If the data you need to pass doesn't fit into that when stringified you'll need to do some compression, for example for @Dragonite I have this https://github.com/favware/dragonite/blob/main/src/lib/util/utils.ts
Sapphire Framework
What are they? | Sapphire
These are interaction handlers! A simple class you can extend to handle almost all the interactions you may receive in
jwn
jwn12mo ago
Tysm
Want results from more Discord servers?
Add your server