diff options
| author | 2021-12-15 17:53:27 +0000 | |
|---|---|---|
| committer | 2021-12-15 17:53:27 +0000 | |
| commit | 8f90473b096e84eb8c1b3ebfa00b9d2e3331cd73 (patch) | |
| tree | a8a8f9433716f497f293b2cb2b55fcd1674680c6 /bot/exts/core | |
| parent | Adding suggestions, removing erroneous commit (diff) | |
| parent | Merge pull request #980 from python-discord/dependabot/pip/lxml-4.6.5 (diff) | |
Merge branch 'main' of https://github.com/python-discord/sir-lancebot
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, |