diff options
| author | Rapptz <[email protected]> | 2019-04-20 17:20:58 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-04-20 17:20:58 -0400 |
| commit | 919dbcafb33eb4e2bb595d7e607f525cf2d02178 (patch) | |
| tree | 206ca4b5430c72854cc818c55d82ce8a641ff9ee /discord/ext | |
| parent | [commands] Clean docstrings in Command.parents and Command.root_parent (diff) | |
| download | discord.py-919dbcafb33eb4e2bb595d7e607f525cf2d02178.tar.xz discord.py-919dbcafb33eb4e2bb595d7e607f525cf2d02178.zip | |
Consistent use of __all__ to prevent merge conflicts.
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/cog.py | 5 | ||||
| -rw-r--r-- | discord/ext/commands/converter.py | 23 | ||||
| -rw-r--r-- | discord/ext/commands/cooldowns.py | 6 | ||||
| -rw-r--r-- | discord/ext/commands/core.py | 23 | ||||
| -rw-r--r-- | discord/ext/commands/errors.py | 45 | ||||
| -rw-r--r-- | discord/ext/commands/help.py | 4 |
6 files changed, 82 insertions, 24 deletions
diff --git a/discord/ext/commands/cog.py b/discord/ext/commands/cog.py index 6d5be625..66988a02 100644 --- a/discord/ext/commands/cog.py +++ b/discord/ext/commands/cog.py @@ -28,7 +28,10 @@ import inspect import copy from ._types import _BaseCommand -__all__ = ('CogMeta', 'Cog') +__all__ = ( + 'CogMeta', + 'Cog', +) class CogMeta(type): """Aćmetaclass for defining a cog. diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index fdce15d1..78c9bbf4 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -31,11 +31,24 @@ import discord from .errors import BadArgument, NoPrivateMessage -__all__ = ['Converter', 'MemberConverter', 'UserConverter', 'MessageConverter', - 'TextChannelConverter', 'InviteConverter', 'RoleConverter', - 'GameConverter', 'ColourConverter', 'VoiceChannelConverter', - 'EmojiConverter', 'PartialEmojiConverter', 'CategoryChannelConverter', - 'IDConverter', 'clean_content', 'Greedy'] +__all__ = ( + 'Converter', + 'MemberConverter', + 'UserConverter', + 'MessageConverter', + 'TextChannelConverter', + 'InviteConverter', + 'RoleConverter', + 'GameConverter', + 'ColourConverter', + 'VoiceChannelConverter', + 'EmojiConverter', + 'PartialEmojiConverter', + 'CategoryChannelConverter', + 'IDConverter', + 'clean_content', + 'Greedy', +) def _get_from_guilds(bot, getter, argument): result = None diff --git a/discord/ext/commands/cooldowns.py b/discord/ext/commands/cooldowns.py index 02d5c64d..c7a200c9 100644 --- a/discord/ext/commands/cooldowns.py +++ b/discord/ext/commands/cooldowns.py @@ -27,7 +27,11 @@ DEALINGS IN THE SOFTWARE. import enum import time -__all__ = ['BucketType', 'Cooldown', 'CooldownMapping'] +__all__ = ( + 'BucketType', + 'Cooldown', + 'CooldownMapping', +) class BucketType(enum.Enum): default = 0 diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 321e2c3b..c8f74f56 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -38,10 +38,25 @@ from . import converter as converters from ._types import _BaseCommand from .cog import Cog -__all__ = ['Command', 'Group', 'GroupMixin', 'command', 'group', - 'has_role', 'has_permissions', 'has_any_role', 'check', - 'bot_has_role', 'bot_has_permissions', 'bot_has_any_role', - 'cooldown', 'dm_only', 'guild_only', 'is_owner', 'is_nsfw'] +__all__ = ( + 'Command', + 'Group', + 'GroupMixin', + 'command', + 'group', + 'has_role', + 'has_permissions', + 'has_any_role', + 'check', + 'bot_has_role', + 'bot_has_permissions', + 'bot_has_any_role', + 'cooldown', + 'dm_only', + 'guild_only', + 'is_owner', + 'is_nsfw', +) def wrap_callback(coro): @functools.wraps(coro) diff --git a/discord/ext/commands/errors.py b/discord/ext/commands/errors.py index fff179a2..e41f36bd 100644 --- a/discord/ext/commands/errors.py +++ b/discord/ext/commands/errors.py @@ -27,17 +27,40 @@ DEALINGS IN THE SOFTWARE. from discord.errors import DiscordException -__all__ = ['CommandError', 'MissingRequiredArgument', 'BadArgument', - 'PrivateMessageOnly', 'NoPrivateMessage', 'CheckFailure', - 'CommandNotFound', 'DisabledCommand', 'CommandInvokeError', - 'TooManyArguments','UserInputError', 'CommandOnCooldown', - 'NotOwner', 'MissingRole', 'BotMissingRole', 'MissingAnyRole', - 'BotMissingAnyRole','MissingPermissions', 'BotMissingPermissions', - 'NSFWChannelRequired', 'ConversionError', 'BadUnionArgument', - 'ArgumentParsingError', 'UnexpectedQuoteError', 'InvalidEndOfQuotedStringError', - 'ExpectedClosingQuoteError', 'ExtensionError', 'ExtensionAlreadyLoaded', - 'ExtensionNotLoaded', 'NoEntryPointError', 'ExtensionFailed', - 'ExtensionNotFound'] +__all__ = ( + 'CommandError', + 'MissingRequiredArgument', + 'BadArgument', + 'PrivateMessageOnly', + 'NoPrivateMessage', + 'CheckFailure', + 'CommandNotFound', + 'DisabledCommand', + 'CommandInvokeError', + 'TooManyArguments', + 'UserInputError', + 'CommandOnCooldown', + 'NotOwner', + 'MissingRole', + 'BotMissingRole', + 'MissingAnyRole', + 'BotMissingAnyRole', + 'MissingPermissions', + 'BotMissingPermissions', + 'NSFWChannelRequired', + 'ConversionError', + 'BadUnionArgument', + 'ArgumentParsingError', + 'UnexpectedQuoteError', + 'InvalidEndOfQuotedStringError', + 'ExpectedClosingQuoteError', + 'ExtensionError', + 'ExtensionAlreadyLoaded', + 'ExtensionNotLoaded', + 'NoEntryPointError', + 'ExtensionFailed', + 'ExtensionNotFound', +) class CommandError(DiscordException): r"""The base exception type for all command related errors. diff --git a/discord/ext/commands/help.py b/discord/ext/commands/help.py index cafc20f3..19c762e8 100644 --- a/discord/ext/commands/help.py +++ b/discord/ext/commands/help.py @@ -33,12 +33,12 @@ import discord.utils from .core import Group, Command from .errors import CommandError -__all__ = [ +__all__ = ( 'Paginator', 'HelpCommand', 'DefaultHelpCommand', 'MinimalHelpCommand', -] +) # help -> shows info of bot on top/bottom and lists subcommands # help command -> shows detailed info of command |