Extend BadCmd with different categories of command failure. This not only adds even greater diversity to his insults but also makes them a bit more helpful by hinting at what was wrong.
Some category ideas:
Ambiguous argument
Command was valid, but the argument was ambiguous.
"You're gonna have to be more specific than that.", "Could you be any more vague?", etc.
No results
"Yeah, I've got nothing.", "Can't find a damn thing like that.", etc.
Include a config option for a configurable chance to use one of the generic "invalid" command phrases anyway instead of a more specific one.
New argument to invalid_command event
The invalid_command event shall now accept an err argument, which should be a value from the new CmdErrorType enum. If unspecified, it should default to CmdErrorType.Unspecified (go figure). Now, any module interested in handling command errors can respond accordingly based on the particular reason a command was invalid. Likewise, modules sending an invalid_command event are free to choose whatever error type they deem appropriate.
Extend BadCmd with different categories of command failure. This not only adds even greater diversity to his insults but also makes them a bit more helpful by hinting at what was wrong.
Some category ideas:
Include a config option for a configurable chance to use one of the generic "invalid" command phrases anyway instead of a more specific one.
New argument to
invalid_command
eventThe
invalid_command
event shall now accept anerr
argument, which should be a value from the newCmdErrorType
enum. If unspecified, it should default toCmdErrorType.Unspecified
(go figure). Now, any module interested in handling command errors can respond accordingly based on the particular reason a command was invalid. Likewise, modules sending aninvalid_command
event are free to choose whatever error type they deem appropriate.