[commands] Add a way to enable or disable certain commands.

This commit is contained in:
Rapptz
2016-01-07 17:59:26 -05:00
parent b79a4549ab
commit 25588955e4
2 changed files with 39 additions and 7 deletions

View File

@ -27,7 +27,8 @@ from discord.errors import DiscordException
__all__ = [ 'CommandError', 'MissingRequiredArgument', 'BadArgument',
'NoPrivateMessage', 'CheckFailure', 'CommandNotFound' ]
'NoPrivateMessage', 'CheckFailure', 'CommandNotFound',
'DisabledCommand' ]
class CommandError(DiscordException):
"""The base exception type for all command related errors.
@ -69,3 +70,7 @@ class NoPrivateMessage(CommandError):
class CheckFailure(CommandError):
"""Exception raised when the predicates in :attr:`Command.checks` have failed."""
pass
class DisabledCommand(CommandError):
"""Exception raised when the command being invoked is disabled."""
pass