no error event on subcommand precondition
what event fires when a Subcommand's precondition (on a subcmd, not the whole class) fails? i'm not getting it to SubcommandError or commandDenied
11 Replies
you dont want to use SubcommandError?
i dont think there is any other way
I want to use any event
What I'm saying is it isn't firing
oh
If it's ChatInputSubcommandError, that is
The precondition returns the error response but then nothing happens
well can u show some code
listener
andi know for a fact the precondition returns an error, i checked that
and the command config
MWAdminOnly is the one behaving differently though, not OwnerOnly š¤
precondition
OwnerOnly for comparison
SubcommandPluginEvents.ChatInputSubcommandError
does not emit denied precondition, SubcommandPluginEvents.ChatInputSubcommandDenied
is what you are looking foroh that's a mess
so -Error emits errors for decorators
but -Denied emits errors for preconditions
š
no? Error emits Errors and Denied emits Precondition deny payloads
makes sense to me
bc preconditions deny a command from functioning if it "fails"
Preconditions run before the command, they are PRE conditions.
Decorators however with how they're implemented in TypeScript they run when the function runs and call function.apply to run the normal functionality after finishing the decorator but by that point the function itself is already running, it's no longer PRE function.
ah makes sense