diff options
| author | Rapptz <[email protected]> | 2016-06-10 20:40:35 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-10 20:40:35 -0400 |
| commit | 74cfc53bc82088e8ea2638d38fd03059d7169057 (patch) | |
| tree | f1b024a1cd81155dabcb4cbc0dd7e4da06e9ad87 | |
| parent | [commands] Exceptions raised while invocation raise CommandInvokeError. (diff) | |
| download | discord.py-74cfc53bc82088e8ea2638d38fd03059d7169057.tar.xz discord.py-74cfc53bc82088e8ea2638d38fd03059d7169057.zip | |
[commands] Make it so CommandError does not contain @everyone mentions.
Mitigates some permission elevation issues.
| -rw-r--r-- | discord/ext/commands/errors.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 7ba0285e..c53da8b5 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -39,7 +39,10 @@ class CommandError(DiscordException): in a special way as they are caught and passed into a special event from :class:`Bot`\, :func:`on_command_error`. """ - pass + def __init__(self, message): + # clean-up @everyone and @here mentions + m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere') + super().__init__(m) class CommandNotFound(CommandError): """Exception raised when a command is attempted to be invoked @@ -48,6 +51,7 @@ class CommandNotFound(CommandError): This is not raised for invalid subcommands, rather just the initial main command that is attempted to be invoked. """ + pass class MissingRequiredArgument(CommandError): """Exception raised when parsing a command and a parameter |