ability to handle type errors and other checks with appropriate messages in commandsnextSee original GitHub issue
This is related to the commandsnext module.
I would like my bot to return an appropriate error message to the user when checks fail, such as wrong argument types, Cooldowns, etc.
[Command("foo")] public async Task Foo(CommandContext ctx, int bar)
If a user says
!foo someString, i’d like to be able to tell the user the usage of the !foo command. Right now if a check fails, then the bot fails silently and my users have no idea what’s going on.
The best workaround I can figure is to somehow catch it in the error delegate, and try and figure out what happened based on the generic exception, which is very much not ideal.
Perhaps checks could be paired with failure handlers that we can set.
- Created 5 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
We could then just call the base (your attribute check implementation) and send a message from there.
No. No. No. And, once again, no. Communication is not anywhere near the area of what a check should do. That’s what the event handlers should be doing.
A check should be doing a simple validation. Nothing more.
The problem outlined in here stems from complete lack of knowledge about how event-driven programming and polymorphism work, as well as not reading the docs.
The exception gives you all the details, including the failed checks and the execution context. It’s all listed in the docs and provided examples.
Facts are not insults.