Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong condition while checking for command name #85

Closed
im-trisha opened this issue May 18, 2023 · 1 comment
Closed

Wrong condition while checking for command name #85

im-trisha opened this issue May 18, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@im-trisha
Copy link
Collaborator

In a situation like this:

bot.command('test', test);
bot.command('testing', testing);

Both "test" and "testing" will be matched if the command is /test, this is probably because the command checks using a "startswith"

I suggest to split the command text by spaces, then check if the first element equals "/$command"

@HeySreelal HeySreelal added the bug Something isn't working label May 18, 2023
@HeySreelal HeySreelal self-assigned this May 18, 2023
@HeySreelal
Copy link
Owner

Thanks a lot for bringing this to my attention. I appreciate your input, as I clearly haven't considered this particular scenario earlier.

The code has been rectified in commit 4057c9b. The upcoming update will include this fix.

Once again, thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants