Sort out command registration #4

Open
opened 2018-09-11 16:37:59 +00:00 by Lonami · 0 comments
<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.
``` <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. ```
This repo is archived. You cannot comment on issues.
No Label
No Milestone
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: uniborg/uniborg#4
There is no content yet.