mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-03 10:32:42 +00:00
Consistent use of __all__ to prevent merge conflicts.
This commit is contained in:
parent
c6410ea9ab
commit
919dbcafb3
@ -30,7 +30,12 @@ from .enums import ActivityType, try_enum
|
||||
from .colour import Colour
|
||||
from .utils import _get_as_snowflake
|
||||
|
||||
__all__ = ['Activity', 'Streaming', 'Game', 'Spotify']
|
||||
__all__ = (
|
||||
'Activity',
|
||||
'Streaming',
|
||||
'Game',
|
||||
'Spotify',
|
||||
)
|
||||
|
||||
"""If curious, this is the current schema for an activity.
|
||||
|
||||
|
@ -36,7 +36,7 @@ from .asset import Asset
|
||||
from .errors import ClientException, NoMoreItems
|
||||
from .webhook import Webhook
|
||||
|
||||
__all__ = [
|
||||
__all__ = (
|
||||
'TextChannel',
|
||||
'VoiceChannel',
|
||||
'DMChannel',
|
||||
@ -44,7 +44,7 @@ __all__ = [
|
||||
'StoreChannel',
|
||||
'GroupChannel',
|
||||
'_channel_factory',
|
||||
]
|
||||
)
|
||||
|
||||
async def _single_delete_strategy(messages):
|
||||
for m in messages:
|
||||
|
@ -26,11 +26,27 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
from enum import Enum
|
||||
|
||||
__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'SpeakingState',
|
||||
'VerificationLevel', 'ContentFilter', 'Status', 'DefaultAvatar',
|
||||
'RelationshipType', 'AuditLogAction', 'AuditLogActionCategory',
|
||||
'UserFlags', 'ActivityType', 'HypeSquadHouse', 'NotificationLevel',
|
||||
'PremiumType', 'UserContentFilter', 'FriendFlags', 'Theme']
|
||||
__all__ = (
|
||||
'ChannelType',
|
||||
'MessageType',
|
||||
'VoiceRegion',
|
||||
'SpeakingState',
|
||||
'VerificationLevel',
|
||||
'ContentFilter',
|
||||
'Status',
|
||||
'DefaultAvatar',
|
||||
'RelationshipType',
|
||||
'AuditLogAction',
|
||||
'AuditLogActionCategory',
|
||||
'UserFlags',
|
||||
'ActivityType',
|
||||
'HypeSquadHouse',
|
||||
'NotificationLevel',
|
||||
'PremiumType',
|
||||
'UserContentFilter',
|
||||
'FriendFlags',
|
||||
'Theme',
|
||||
)
|
||||
|
||||
def fast_lookup(cls):
|
||||
# NOTE: implies hashable
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -44,8 +44,13 @@ from .errors import ConnectionClosed, InvalidArgument
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__all__ = ['DiscordWebSocket', 'KeepAliveHandler', 'VoiceKeepAliveHandler',
|
||||
'DiscordVoiceWebSocket', 'ResumeWebSocket']
|
||||
__all__ = (
|
||||
'DiscordWebSocket',
|
||||
'KeepAliveHandler',
|
||||
'VoiceKeepAliveHandler',
|
||||
'DiscordVoiceWebSocket',
|
||||
'ResumeWebSocket',
|
||||
)
|
||||
|
||||
class ResumeWebSocket(Exception):
|
||||
"""Signals to initialise via RESUME opcode instead of IDENTIFY."""
|
||||
|
@ -37,7 +37,12 @@ from .opus import Encoder as OpusEncoder
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__all__ = ['AudioSource', 'PCMAudio', 'FFmpegPCMAudio', 'PCMVolumeTransformer']
|
||||
__all__ = (
|
||||
'AudioSource',
|
||||
'PCMAudio',
|
||||
'FFmpegPCMAudio',
|
||||
'PCMVolumeTransformer',
|
||||
)
|
||||
|
||||
class AudioSource:
|
||||
"""Represents an audio stream.
|
||||
|
@ -36,7 +36,12 @@ from .errors import InvalidArgument, HTTPException, Forbidden, NotFound
|
||||
from .user import BaseUser, User
|
||||
from .asset import Asset
|
||||
|
||||
__all__ = ['WebhookAdapter', 'AsyncWebhookAdapter', 'RequestsWebhookAdapter', 'Webhook']
|
||||
__all__ = (
|
||||
'WebhookAdapter',
|
||||
'AsyncWebhookAdapter',
|
||||
'RequestsWebhookAdapter',
|
||||
'Webhook',
|
||||
)
|
||||
|
||||
class WebhookAdapter:
|
||||
"""Base class for all webhook adapters.
|
||||
|
Loading…
x
Reference in New Issue
Block a user