ZeroKnight / ZeroBot

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

Completely rethink the `core_command_*` interface and its associated data structures #49

Open ZeroKnight opened 3 months ago

ZeroKnight commented 3 months ago

All of these "interfaces" kind of suck, frankly. They were written in essentially one sitting each as a schlocky proof-of-concept to get some kind of formatted output for these commands on Discord. Some of it is on the right track, but overall they need to be cleaned up; some vastly more than others (cancel).

In general, these structured "Result" objects should be more tightly designed, not a mix of namedtuples and dataclasses, and defined in one place. I feel that refactoring CommandHelp will trigger or coincide with a refactor of Command objects in general.

The core_command_* callbacks could probably even be squashed into one generic core_command event handler with the command name as a parameter, similar to core events.