[commands] Allow passing of a message to NoPrivateMessage again.
Prevents an accidental breaking change.
This commit is contained in:
parent
188bd4e708
commit
5a7b5cd14b
@ -1525,7 +1525,7 @@ def dm_only():
|
|||||||
|
|
||||||
def predicate(ctx):
|
def predicate(ctx):
|
||||||
if ctx.guild is not None:
|
if ctx.guild is not None:
|
||||||
raise PrivateMessageOnly('This command can only be used in private messages.')
|
raise PrivateMessageOnly()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return check(predicate)
|
return check(predicate)
|
||||||
|
@ -159,7 +159,8 @@ class PrivateMessageOnly(CheckFailure):
|
|||||||
|
|
||||||
This inherits from :exc:`CheckFailure`
|
This inherits from :exc:`CheckFailure`
|
||||||
"""
|
"""
|
||||||
pass
|
def __init__(self, message=None):
|
||||||
|
super().__init__(message or 'This command can only be used in private messages.')
|
||||||
|
|
||||||
class NoPrivateMessage(CheckFailure):
|
class NoPrivateMessage(CheckFailure):
|
||||||
"""Exception raised when an operation does not work in private message
|
"""Exception raised when an operation does not work in private message
|
||||||
@ -168,8 +169,8 @@ class NoPrivateMessage(CheckFailure):
|
|||||||
This inherits from :exc:`CheckFailure`
|
This inherits from :exc:`CheckFailure`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, message=None):
|
||||||
super().__init__('This command cannot be used in private messages.')
|
super().__init__(message or 'This command cannot be used in private messages.')
|
||||||
|
|
||||||
class NotOwner(CheckFailure):
|
class NotOwner(CheckFailure):
|
||||||
"""Exception raised when the message author is not the owner of the bot.
|
"""Exception raised when the message author is not the owner of the bot.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user