ZeroKnight / ZeroBot

My personal IRC/Multi-protocol Bot created (and re-created) for education and amusement.
MIT License
1 stars 0 forks source link

Add failure categories to BadCmd #26

Closed ZeroKnight closed 3 years ago

ZeroKnight commented 3 years ago

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 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.