mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 10:49:24 +00:00
[commands] Make the CommandError required argument optional again.
This commit is contained in:
parent
a175c86aa1
commit
5f9ed8c9d2
@ -39,10 +39,13 @@ 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`.
|
||||||
"""
|
"""
|
||||||
def __init__(self, message):
|
def __init__(self, message=None, *args):
|
||||||
|
if message is not None:
|
||||||
# clean-up @everyone and @here mentions
|
# clean-up @everyone and @here mentions
|
||||||
m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
|
m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
|
||||||
super().__init__(m)
|
super().__init__(m, *args)
|
||||||
|
else:
|
||||||
|
super().__init__(*args)
|
||||||
|
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user