messageRun commands
I'm getting an issue and honestly, don't know what's wrong, i'm using the template generated by the CLI and everything runs fine, however, when i try preconditions on
messageRun subcommands
they just not work for some reason? they work on messageRun
commands but not subcommands.
For example, i'm trying the precondition that comes with the template
it works on chatInput Subcommands and Commands, but not on messageRun subcommands
the command is fired but the precondition does not return anything and the command does not return anything either.Solution:Jump to solution
If I use
sapphire new
and then make only 2 edits:
1. Fill in .env
2. Add preconditions: ['OwnerOnly']
to src/commands/General/command-with-subcommands.ts
then it does work...2 Replies
Solution
If I use
sapphire new
and then make only 2 edits:
1. Fill in .env
2. Add preconditions: ['OwnerOnly']
to src/commands/General/command-with-subcommands.ts
then it does work
Note that there is no reply from the bot at the bottom because no listener for SubcommandPluginEvents.MessageSubcommandDenied
is included in the template, in case that's all that you're wondering about. A precondition works if the command doesn't execute, that's the whole point of a precondition after all.
Considering that your file is seemingly called OwnerOnlyPrecondition
as opposed to the default OwnerOnly
, are you sure you didn't break anything along the way?It was that i was missing the listener implementation for Message Subcommands, about the name i just renamed the precondition, thanks for the help!