aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-06-10 23:42:21 -0400
committerRapptz <[email protected]>2016-06-10 23:50:17 -0400
commit5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83 (patch)
tree0496ad0a8c3c9fe6803e38abcb1f7bdd510c3a37
parentAdd Client.application_info to retrieve the current app info. (diff)
downloaddiscord.py-5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83.tar.xz
discord.py-5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83.zip
[commands] Make the CommandError required argument optional again.
-rw-r--r--discord/ext/commands/errors.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py
index c53da8b5..a2fef1fe 100644
--- a/discord/ext/commands/errors.py
+++ b/discord/ext/commands/errors.py
@@ -39,10 +39,13 @@ class CommandError(DiscordException):
in a special way as they are caught and passed into a special event
from :class:`Bot`\, :func:`on_command_error`.
"""
- def __init__(self, message):
- # clean-up @everyone and @here mentions
- m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
- super().__init__(m)
+ def __init__(self, message=None, *args):
+ if message is not None:
+ # clean-up @everyone and @here mentions
+ m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
+ super().__init__(m, *args)
+ else:
+ super().__init__(*args)
class CommandNotFound(CommandError):
"""Exception raised when a command is attempted to be invoked