Customiseable command terms
Closed this issue · 0 comments
Currently commands must have a programmed term that users can use to interact with it. So far, every term is prefixed with a ?
character to help separate the terms from other commands from other bots. However, there may be a time when a command collides with another command. On top of that, any command from another bot that starts with a ?
character will trigger BlendoBot to say it had an unknown command sent to it.
The proposed solution is to allow commands to define a default command term for them, and then when they're instantiated on the server they register that term for themselves. Commands can then remember what term they've been assigned, and can have them reassigned at any point in time.
The proposed syntax will be as such:
?admin command rename [command term] [new name]
(renames a command to a new term)
?admin command unknowntoggle
(enables/disables the "I didn't know what you meant" message)
?admin command unknownprefix [prefix]
(changes the prefix to search for if a command could not be found)
Some additional work will have to be involved to make this all work. Currently, almost every command hard-codes its term in all of its messages, so they will need to be changed. There will also need to be a bit of additional work to make sure the renamed terms persist between sessions of BlendoBot. Terms will also have to be checked on both rename and startup. A rename should be rejected if the term already exists on that server. If two commands have the same name on startup, the latter commands should post-fix numbers onto the term (e.g. if two commands were called ?ac
, the second one should be called ?ac2
).
This will also solve #26, since the command name will be dynamic. It may also solve #15 on its own.