diff options
author | 2022-02-14 23:41:14 +0000 | |
---|---|---|
committer | 2022-02-14 23:41:14 +0000 | |
commit | 657aaf5f613b0bd219d67c71f7dc37ede0bb6aab (patch) | |
tree | 548e48ae21a98d5e6e16e8619d1af4ee75fe8b7a /bot/exts/core | |
parent | fix: Add newlines in codeblock formatting (diff) | |
parent | Merge pull request #1026 from Shom770/fix-trivia-night (diff) |
Merge branch 'main' into merge-github-issues
Diffstat (limited to 'bot/exts/core')
-rw-r--r-- | bot/exts/core/error_handler.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bot/exts/core/error_handler.py b/bot/exts/core/error_handler.py index fd2123e7..676a1e70 100644 --- a/bot/exts/core/error_handler.py +++ b/bot/exts/core/error_handler.py @@ -12,7 +12,7 @@ from sentry_sdk import push_scope from bot.bot import Bot from bot.constants import Channels, Colours, ERROR_REPLIES, NEGATIVE_REPLIES, RedirectOutput from bot.utils.decorators import InChannelCheckFailure, InMonthCheckFailure -from bot.utils.exceptions import APIError, UserNotPlayingError +from bot.utils.exceptions import APIError, MovedCommandError, UserNotPlayingError log = logging.getLogger(__name__) @@ -130,6 +130,14 @@ class CommandErrorHandler(commands.Cog): ) return + if isinstance(error, MovedCommandError): + description = ( + f"This command, `{ctx.prefix}{ctx.command.qualified_name}` has moved to `{error.new_command_name}`.\n" + f"Please use `{error.new_command_name}` instead." + ) + await ctx.send(embed=self.error_embed(description, NEGATIVE_REPLIES)) + return + with push_scope() as scope: scope.user = { "id": ctx.author.id, |