From 74cfc53bc82088e8ea2638d38fd03059d7169057 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 10 Jun 2016 20:40:35 -0400 Subject: [PATCH] [commands] Make it so CommandError does not contain @everyone mentions. Mitigates some permission elevation issues. --- discord/ext/commands/errors.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index 7ba0285e8..c53da8b52 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