bitbot
bitbot copied to clipboard
the commands module does not spark joy
converting PRIVMSG to command events (and, in the process, checking permissions etc) is arguably the most important function of bitbot but alas; the module for handling this is very old code and a collection of nasty botches.
the system that denotes command callbacks (and authentication criteria) as well as stdout/stding is solid but how it is handled in src/core_modules/commands/__init__.py is hard to read, illogical, intransigent and prone to bugs.
On top of this, there are two specific interactions with the commands system that I want to make possible that currently are not;
- allow for factoids module to catch a special command trigger and rewrite the message to pass it down the usual workflow of a command dispatch
- allow for commands to be executed on a cron job (n.b.: without a sender user context)
adding these is going to be quite difficult whilst the commands module is in a poor state and, in the interest of maintainability, I think we can squash all of these in an entire rewrite of the commands module.
i should pay attention to #138 when working on this
I think I'm going to tackle this issue by slowly chipping away at significant bad parts of the commands module (e.g. jesopo/bitbot@7bf0b6ed) until the logic is clean enough to refactor the whole module.