forwards-long-jump / discotron

Modular Discord bot supporting plugins hosted on git repositories
MIT License
3 stars 5 forks source link

Invalid command handler #35

Open RedMser opened 4 years ago

RedMser commented 4 years ago

When a plugin defines one or more commands which are triggered via prefixed notation, and a user sends a message with the prefix, we check if it matches any command.

If it doesn't, the plugin could define a "invalid command" handler. This could be used to display a help message (or "did you mean" messages), or to treat it like a "custom command" (stupid example: feed the whole message into an AI and make the bot respond).

By default, the invalid command handler could either:

  1. do nothing (ignore the message, as if it wasn't a command), or
  2. show the help text for the plugin.

Not sure about pros and cons for each, or if another solution would be useful, but the concept as a whole has potential I feel.