diff options
| author | Rapptz <[email protected]> | 2016-06-10 23:42:21 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-10 23:50:17 -0400 |
| commit | 5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83 (patch) | |
| tree | 0496ad0a8c3c9fe6803e38abcb1f7bdd510c3a37 | |
| parent | Add Client.application_info to retrieve the current app info. (diff) | |
| download | discord.py-5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83.tar.xz discord.py-5f9ed8c9d201f1520aaf46c5dc73ca14e44eaa83.zip | |
[commands] Make the CommandError required argument optional again.
| -rw-r--r-- | discord/ext/commands/errors.py | 11 |
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 |