[commands] Add is_owner check and Bot.is_owner.

This commit is contained in:
Rapptz
2017-03-27 06:55:21 -04:00
parent afb64fb5e3
commit 5c5e7ae1d6
3 changed files with 49 additions and 2 deletions

View File

@ -29,7 +29,7 @@ from discord.errors import DiscordException
__all__ = [ 'CommandError', 'MissingRequiredArgument', 'BadArgument',
'NoPrivateMessage', 'CheckFailure', 'CommandNotFound',
'DisabledCommand', 'CommandInvokeError', 'TooManyArguments',
'UserInputError', 'CommandOnCooldown' ]
'UserInputError', 'CommandOnCooldown', 'NotOwner' ]
class CommandError(DiscordException):
"""The base exception type for all command related errors.
@ -100,6 +100,10 @@ class NoPrivateMessage(CheckFailure):
"""
pass
class NotOwner(CheckFailure):
"""Exception raised when the message author is not the owner of the bot."""
pass
class DisabledCommand(CommandError):
"""Exception raised when the command being invoked is disabled."""
pass