Browse Source

[commands] Make it so CommandError does not contain @everyone mentions.

Mitigates some permission elevation issues.
pull/204/merge
Rapptz 9 years ago
parent
commit
74cfc53bc8
  1. 6
      discord/ext/commands/errors.py

6
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 in a special way as they are caught and passed into a special event
from :class:`Bot`\, :func:`on_command_error`. 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): class CommandNotFound(CommandError):
"""Exception raised when a command is attempted to be invoked """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 This is not raised for invalid subcommands, rather just the
initial main command that is attempted to be invoked. initial main command that is attempted to be invoked.
""" """
pass
class MissingRequiredArgument(CommandError): class MissingRequiredArgument(CommandError):
"""Exception raised when parsing a command and a parameter """Exception raised when parsing a command and a parameter

Loading…
Cancel
Save