diff options
| author | 2019-08-14 15:24:01 -0400 | |
|---|---|---|
| committer | 2019-08-14 15:24:01 -0400 | |
| commit | 119d542483f59d3f581b168854af9012208abf7d (patch) | |
| tree | 7706226d2e01cfb128a71d1ca52404a1246407e3 /bot/seasons/evergreen/error_handler.py | |
| parent | moved data grab to module level, changed var to constant (diff) | |
| parent | Merge pull request #257 from vivax3794/minesweeper-lenght-fix (diff) | |
Merge pull request #1 from python-discord/master
update
Diffstat (limited to 'bot/seasons/evergreen/error_handler.py')
| -rw-r--r-- | bot/seasons/evergreen/error_handler.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bot/seasons/evergreen/error_handler.py b/bot/seasons/evergreen/error_handler.py index f4457f8f..6690cf89 100644 --- a/bot/seasons/evergreen/error_handler.py +++ b/bot/seasons/evergreen/error_handler.py @@ -1,10 +1,15 @@ import logging
import math
+import random
import sys
import traceback
+from discord import Colour, Embed
from discord.ext import commands
+from bot.constants import NEGATIVE_REPLIES
+from bot.decorators import InChannelCheckFailure
+
log = logging.getLogger(__name__)
@@ -34,6 +39,16 @@ class CommandErrorHandler(commands.Cog): error = getattr(error, 'original', error)
+ if isinstance(error, InChannelCheckFailure):
+ logging.debug(
+ f"{ctx.author} the command '{ctx.command}', but they did not have "
+ f"permissions to run commands in the channel {ctx.channel}!"
+ )
+ embed = Embed(colour=Colour.red())
+ embed.title = random.choice(NEGATIVE_REPLIES)
+ embed.description = str(error)
+ return await ctx.send(embed=embed)
+
if isinstance(error, commands.CommandNotFound):
return logging.debug(
f"{ctx.author} called '{ctx.message.content}' but no command was found."
|