Subcommand unintentionally triggers Events.MessageCommandRun
I have a
/dpm
subcommand is defined as:
I noticed a strange occurence where, if my message command prefix is set to /
, and I run /dpm
as a message, the MessageCommandRun
event will be triggered and gives this error, even though I never registered a messageRun
method.
Wondering if this is intended or am I doing something wrong?3 Replies
Solution
Set a default on one of the subcommands or handle the error
Also you should really not use / as default prefix because that's going to confuse literally everyone. No one is going to know if you have a message based bot or a slash command bot.
ah, my bot actually doesn't use message commands, I have
/
prefix purely to remind users how to use slash commands properly should they wrongly send the command as a message. There are way too many of them!
Thank you for the default tip, even though jt still triggers the MessageRun event it is a sufficient workaround!