bitbot icon indicating copy to clipboard operation
bitbot copied to clipboard

the commands module does not spark joy

Open jesopo opened this issue 5 years ago • 3 comments

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.

jesopo avatar Feb 22 '20 15:02 jesopo

i should pay attention to #138 when working on this

jesopo avatar Mar 05 '20 09:03 jesopo

another rationale for this:

  • I want to introduce things akin to eggdrop's partyline

jesopo avatar Mar 09 '20 09:03 jesopo

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.

jesopo avatar Mar 09 '20 09:03 jesopo