Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Command Dispatcher matchDefault passing incorrect argument to unknown command #266

Open
jonahsnider opened this issue Jun 21, 2019 · 0 comments

Comments

@jonahsnider
Copy link
Contributor

What should happen

When a command that doesn't exist is run, the matchDefault function from the command dispatcher should pass in the attempted command into the command that handles unknown commands.

What actually happens

When an unknown command is run somewhere not in a DM, matchDefault passes in the prefix of the attempted command instead of the actual command.

I think commit d645f03 may have broken this, as it changed the logic that is involved here.

Example

Bad

For example, a user mistypes the help command in a text channel.

User: `!hlep`
`matchDefault`: `unknownCommand("!") // Passes in the command prefix, not `hlep``

Good

A user does the same thing in a DM (where prefixes are not required)

User: `hlep`
`matchDefault`: `unknownCommand("hlep") // Passes in the command they tried to run`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants