feat: add in ability to supply custom command matching interface #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
currently when using command groups or spaces in commands, commands can leak between groups. This can cause undesired and confusing results.
example:
I have 2 commands. one in a group and one not in a group
here is an example conversation. Using @ mentions for ease of testing, but same behavior is seen with registered / commands
kmcgovern
demobot
kmcgovern
demobot
kmcgovern
demobot
my expectation would be that
/person echo
does nothing instead of the current behavior of calling the echo command as it is only registered as a top-level command.From my investigation into this, it looks like intended behavior from the commander package. The
tokenize
andmatch
functions are pretty straight forward and I can see why someone might want the current functionality. For my use-case i do not want the current behavior and require no cross-leakage of commands/words. SinceCommand
is defined as an interface in slacker, I thought it would be good allow providing a custom implementation rather than potentially breaking some functionality of the commander package.