Sort out command registration #4
Lonami
commented 2018-09-11 16:37:59 +00:00
Owner
```
<tan> Currently things are a little messy with every command defining its own
regex to match against, and some supporting edited messages and others seemingly
just forgetting to. There should be a cleaner way for plugins to register what
they want to match.
<lonami> Any ideas on how that could be achieved? Currently each plugin is a
separate file, which you can just place in the directory and it gets loaded.
That should probably be kept. By letting the plugins use @borg.on, they have
less restrictions and can do virtually anything with the borg.
<street> Handling of edited message is ignored most of the time by design.
<street> For registering commands, I think adding something like
@borg.command("somecommand") would be nice as a generic option, it could
even include running the arguments through a lexer to simplify the plugin's
job, and it should definitely handle detecting whether the bot is logged in
as a bot or a user and formatting the commands appropriately.
```
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?