Default preconditions
I'd like to create a check for all commands before they are run, and I'd like an alternative to pasting a precondition in every command file. Is there another way I can, for example, intercept the
interactionCreate
event or something?Solution:Jump to solution
If it's a custom precondition that you wrote yourself add the
position
option to any value (the higher the value the higher the priority) and it'll turn into a global precondition.3 Replies
Solution
If it's a custom precondition that you wrote yourself add the
position
option to any value (the higher the value the higher the priority) and it'll turn into a global precondition.I wrote a guide page for this topic now https://www.sapphirejs.dev/docs/Guide/preconditions/global-preconditions
Sapphire Framework
Global preconditions | Sapphire
Sometimes you want a precondition that automatically runs for every command, without having to add it to each command.
Thanks