[commands] Add CommandNotFound error.

This commit is contained in:
Rapptz
2016-01-05 01:11:52 -05:00
parent 246698254f
commit 51186c3ca4
3 changed files with 22 additions and 11 deletions

View File

@ -27,7 +27,7 @@ from discord.errors import DiscordException
__all__ = [ 'CommandError', 'MissingRequiredArgument', 'BadArgument',
'NoPrivateMessage', 'CheckFailure' ]
'NoPrivateMessage', 'CheckFailure', 'CommandNotFound' ]
class CommandError(DiscordException):
"""The base exception type for all command related errors.
@ -40,6 +40,14 @@ class CommandError(DiscordException):
"""
pass
class CommandNotFound(CommandError):
"""Exception raised when a command is attempted to be invoked
but no command under that name is found.
This is not raised for invalid subcommands, rather just the
initial main command that is attempted to be invoked.
"""
class MissingRequiredArgument(CommandError):
"""Exception raised when parsing a command and a parameter
that is required is not encountered.