diff options
| author | 2020-03-15 14:32:12 +0100 | |
|---|---|---|
| committer | 2020-03-15 14:32:12 +0100 | |
| commit | 6e8b239f407bf079e35a03df41d55c042b026406 (patch) | |
| tree | edbd9d5f919a19af2a0c793902ed0b8f4f29bbfa /bot/seasons/evergreen/error_handler.py | |
| parent | Deseasonify: lock branding commands to moderation roles (diff) | |
Deseasonify: improve `in_month` command check
Raise a custom exception if the command fails. This is then handled
in the error handler, and the user will be informed of which months
allow the invoked command.
Diffstat (limited to 'bot/seasons/evergreen/error_handler.py')
| -rw-r--r-- | bot/seasons/evergreen/error_handler.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index 0d8bb0bb..ba6ca5ec 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -7,7 +7,7 @@ from discord import Embed, Message from discord.ext import commands from bot.constants import Colours, ERROR_REPLIES, NEGATIVE_REPLIES -from bot.decorators import InChannelCheckFailure +from bot.decorators import InChannelCheckFailure, InMonthCheckFailure log = logging.getLogger(__name__) @@ -55,7 +55,7 @@ class CommandErrorHandler(commands.Cog): if isinstance(error, commands.CommandNotFound): return - if isinstance(error, InChannelCheckFailure): + if isinstance(error, (InChannelCheckFailure, InMonthCheckFailure)): await ctx.send(embed=self.error_embed(str(error), NEGATIVE_REPLIES), delete_after=7.5) return |