diff options
| author | 2021-12-15 14:32:23 +0000 | |
|---|---|---|
| committer | 2021-12-15 14:32:23 +0000 | |
| commit | 451c6cc286d52b4b38060b0864eb675b5a4a4f5b (patch) | |
| tree | b6626c941444c0f1d7f8eba81ae9ec49da2af399 /bot/exts/core | |
| parent | Merge pull request #974 from python-discord/fix-message-converter (diff) | |
| parent | Merge branch 'main' into yank-lovefest-sub (diff) | |
Merge pull request #971 from onerandomusername/yank-lovefest-sub
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, |