Browse Source

[commands] BadBooleanArgument -> BadBoolArgument

pull/5793/head
Rapptz 5 years ago
parent
commit
0a7e2f7c2f
  1. 2
      discord/ext/commands/core.py
  2. 4
      discord/ext/commands/errors.py
  3. 4
      docs/ext/commands/api.rst

2
discord/ext/commands/core.py

@ -107,7 +107,7 @@ def _convert_to_bool(argument):
elif lowered in ('no', 'n', 'false', 'f', '0', 'disable', 'off'): elif lowered in ('no', 'n', 'false', 'f', '0', 'disable', 'off'):
return False return False
else: else:
raise BadBooleanArgument(lowered) raise BadBoolArgument(lowered)
class _CaseInsensitiveDict(dict): class _CaseInsensitiveDict(dict):
def __contains__(self, k): def __contains__(self, k):

4
discord/ext/commands/errors.py

@ -53,7 +53,7 @@ __all__ = (
'BadInviteArgument', 'BadInviteArgument',
'EmojiNotFound', 'EmojiNotFound',
'PartialEmojiConversionFailure', 'PartialEmojiConversionFailure',
'BadBooleanArgument', 'BadBoolArgument',
'MissingRole', 'MissingRole',
'BotMissingRole', 'BotMissingRole',
'MissingAnyRole', 'MissingAnyRole',
@ -373,7 +373,7 @@ class PartialEmojiConversionFailure(BadArgument):
self.argument = argument self.argument = argument
super().__init__('Couldn\'t convert "{}" to PartialEmoji.'.format(argument)) super().__init__('Couldn\'t convert "{}" to PartialEmoji.'.format(argument))
class BadBooleanArgument(BadArgument): class BadBoolArgument(BadArgument):
"""Exception raised when a boolean argument was not convertable. """Exception raised when a boolean argument was not convertable.
This inherits from :exc:`BadArgument` This inherits from :exc:`BadArgument`

4
docs/ext/commands/api.rst

@ -368,7 +368,7 @@ Exceptions
.. autoexception:: discord.ext.commands.PartialEmojiConversionFailure .. autoexception:: discord.ext.commands.PartialEmojiConversionFailure
:members: :members:
.. autoexception:: discord.ext.commands.BadBooleanArgument .. autoexception:: discord.ext.commands.BadBoolArgument
:members: :members:
.. autoexception:: discord.ext.commands.MissingPermissions .. autoexception:: discord.ext.commands.MissingPermissions
@ -436,7 +436,7 @@ Exception Hierarchy
- :exc:`~.commands.BadInviteArgument` - :exc:`~.commands.BadInviteArgument`
- :exc:`~.commands.EmojiNotFound` - :exc:`~.commands.EmojiNotFound`
- :exc:`~.commands.PartialEmojiConversionFailure` - :exc:`~.commands.PartialEmojiConversionFailure`
- :exc:`~.commands.BadBooleanArgument` - :exc:`~.commands.BadBoolArgument`
- :exc:`~.commands.BadUnionArgument` - :exc:`~.commands.BadUnionArgument`
- :exc:`~.commands.ArgumentParsingError` - :exc:`~.commands.ArgumentParsingError`
- :exc:`~.commands.UnexpectedQuoteError` - :exc:`~.commands.UnexpectedQuoteError`

Loading…
Cancel
Save