diff options
author | 2022-09-18 22:05:47 +0100 | |
---|---|---|
committer | 2022-09-18 22:05:47 +0100 | |
commit | e5c1ac6db63cb7368fe5511ffb7f13ac651d3140 (patch) | |
tree | 7496c11b33bf4d183286382d02b68ca5f0ba82e5 /bot | |
parent | Fix Poetry 1.2 Support (#1099) (diff) | |
parent | Merge branch 'main' into fix-issue-1090 (diff) |
Merge pull request #1096 from python-discord/fix-issue-1090
Diffstat (limited to 'bot')
-rw-r--r-- | bot/exts/core/error_handler.py | 3 | ||||
-rw-r--r-- | bot/utils/commands.py | 6 |
2 files changed, 2 insertions, 7 deletions
diff --git a/bot/exts/core/error_handler.py b/bot/exts/core/error_handler.py index 4578f734..372b82d2 100644 --- a/bot/exts/core/error_handler.py +++ b/bot/exts/core/error_handler.py @@ -171,9 +171,8 @@ class CommandErrorHandler(commands.Cog): if not await similar_command.can_run(ctx): log.debug(log_msg) continue - except commands.errors.CommandError as cmd_error: + except commands.errors.CommandError: log.debug(log_msg) - await self.on_command_error(ctx, cmd_error) continue command_suggestions.append(similar_command_name) diff --git a/bot/utils/commands.py b/bot/utils/commands.py index 7c04a25a..2058507e 100644 --- a/bot/utils/commands.py +++ b/bot/utils/commands.py @@ -1,11 +1,7 @@ -from typing import Optional - from rapidfuzz import process -def get_command_suggestions( - all_commands: list[str], query: str, *, cutoff: int = 60, limit: int = 3 -) -> Optional[list]: +def get_command_suggestions(all_commands: list[str], query: str, *, cutoff: int = 60, limit: int = 3) -> list[str]: """Get similar command names.""" results = process.extract(query, all_commands, score_cutoff=cutoff, limit=limit) return [result[0] for result in results] |