Feature: suggest command usage for misspelt commands#760
Conversation
There was a problem hiding this comment.
The tags cog is not the right place for this since this feature is not actually related to tags. As it is, it will suggest commands when tags are fetched. This may make sense when this is triggered via the CommandNotFound error but it doesn't when using the !tags get command or any of its aliases.
You're piggybacking off the tags being fetched by the error handler when a command isn't found. Instead, the error handler should call this code more directly. It may be better to wait for #757 since that cleans up the error handler quite a bit.
Furthermore, is this handling subcommands properly? Is fuzzywuzzy good enough for this application? After all, the tags had better results with a custom algorithm.
|
Hey mark, as I've said, the current structure of the error_handler is a bit hard to change for that usage (since it reinvokes every misspelt command as a tag), I can wait or change its implementation if needed |
Migration to error_handler.py Suggesting misspelt commands, in progress
…github.com/python-discord/bot into feat/F4zi/CommandSuggestion
Since its used to get the input of the command, its not needed again In the function (callback) call
preventing message spam by the bot when commands are misspelt
When found a similar command, the bot sent a suggestion about the full command name This was fixed by saving the matching alias and sending it instead of sending the full command name
|
Hello, the feature is ready. Note: Few suggestions could result in a spam |
The returned value was changed from True to False If we didn't return True (sent the tag) throughout the code It means we didn't send anything, we should return False
get_command was changed to - display_tag, the name didn't fit, since its not the command itself. command_on_cooldown was taken out of display_tag to get the option to reuse it in another scope Docstrings modified
|
I screwed up, I am sorry. Attempting to fix. |
e46693a to
9a00d70
Compare
Since the cogs folder has been removed, the error_handler and tag cogs had to be removed and transfer into their respective places in the exts folder.









Feature: suggest similar command(s) to a misspelt command
Resolves #742