aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNadir Chowdhury <[email protected]>2021-04-07 07:30:32 +0100
committerGitHub <[email protected]>2021-04-07 02:30:32 -0400
commit89456022cf952a0d094d3ed438e279db02535632 (patch)
tree216671c8bfeb6c861236dc42ba82a7b08cf52f69
parentAdd Embed.__bool__ (diff)
downloaddiscord.py-89456022cf952a0d094d3ed438e279db02535632.tar.xz
discord.py-89456022cf952a0d094d3ed438e279db02535632.zip
Add `__all__` to remaining modules
-rw-r--r--discord/__init__.py48
-rw-r--r--discord/abc.py9
-rw-r--r--discord/appinfo.py3
-rw-r--r--discord/asset.py4
-rw-r--r--discord/audit_logs.py6
-rw-r--r--discord/backoff.py4
-rw-r--r--discord/client.py4
-rw-r--r--discord/colour.py5
-rw-r--r--discord/context_managers.py4
-rw-r--r--discord/embeds.py4
-rw-r--r--discord/emoji.py4
-rw-r--r--discord/errors.py16
-rw-r--r--discord/ext/commands/__init__.py4
-rw-r--r--discord/ext/commands/bot.py7
-rw-r--r--discord/ext/commands/context.py4
-rw-r--r--discord/ext/tasks/__init__.py4
-rw-r--r--discord/file.py4
-rw-r--r--discord/guild.py3
-rw-r--r--discord/integrations.py5
-rw-r--r--discord/invite.py6
-rw-r--r--discord/member.py5
-rw-r--r--discord/mentions.py4
-rw-r--r--discord/mixins.py5
-rw-r--r--discord/object.py4
-rw-r--r--discord/oggparse.py6
-rw-r--r--discord/opus.py6
-rw-r--r--discord/partial_emoji.py3
-rw-r--r--discord/raw_models.py9
-rw-r--r--discord/reaction.py4
-rw-r--r--discord/role.py5
-rw-r--r--discord/shard.py5
-rw-r--r--discord/sticker.py4
-rw-r--r--discord/user.py5
-rw-r--r--discord/utils.py12
-rw-r--r--discord/voice_client.py5
-rw-r--r--discord/widget.py6
36 files changed, 210 insertions, 26 deletions
diff --git a/discord/__init__.py b/discord/__init__.py
index 6ed1ec6a..dbbb54c9 100644
--- a/discord/__init__.py
+++ b/discord/__init__.py
@@ -20,41 +20,41 @@ __path__ = __import__('pkgutil').extend_path(__path__, __name__)
from collections import namedtuple
import logging
-from .client import Client
-from .appinfo import AppInfo
-from .user import User, ClientUser
-from .emoji import Emoji
-from .partial_emoji import PartialEmoji
+from .client import *
+from .appinfo import *
+from .user import *
+from .emoji import *
+from .partial_emoji import *
from .activity import *
from .channel import *
-from .guild import Guild
+from .guild import *
from .flags import *
-from .member import Member, VoiceState
+from .member import *
from .message import *
-from .asset import Asset
+from .asset import *
from .errors import *
-from .permissions import Permissions, PermissionOverwrite
-from .role import Role, RoleTags
-from .file import File
-from .colour import Color, Colour
-from .integrations import Integration, IntegrationAccount
-from .invite import Invite, PartialInviteChannel, PartialInviteGuild
-from .template import Template
-from .widget import Widget, WidgetMember, WidgetChannel
-from .object import Object
-from .reaction import Reaction
+from .permissions import *
+from .role import *
+from .file import *
+from .colour import *
+from .integrations import *
+from .invite import *
+from .template import *
+from .widget import *
+from .object import *
+from .reaction import *
from . import utils, opus, abc
from .enums import *
-from .embeds import Embed
-from .mentions import AllowedMentions
-from .shard import AutoShardedClient, ShardInfo
+from .embeds import *
+from .mentions import *
+from .shard import *
from .player import *
from .webhook import *
-from .voice_client import VoiceClient, VoiceProtocol
-from .audit_logs import AuditLogChanges, AuditLogEntry, AuditLogDiff
+from .voice_client import *
+from .audit_logs import *
from .raw_models import *
from .team import *
-from .sticker import Sticker
+from .sticker import *
from .interactions import *
VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial')
diff --git a/discord/abc.py b/discord/abc.py
index 0130aa70..18e8a062 100644
--- a/discord/abc.py
+++ b/discord/abc.py
@@ -41,6 +41,15 @@ from .file import File
from .voice_client import VoiceClient, VoiceProtocol
from . import utils
+__all__ = (
+ 'Snowflake',
+ 'User',
+ 'PrivateChannel',
+ 'GuildChannel',
+ 'Messageable',
+ 'Connectable',
+)
+
if TYPE_CHECKING:
from datetime import datetime
diff --git a/discord/appinfo.py b/discord/appinfo.py
index 9af4a373..066cf6f0 100644
--- a/discord/appinfo.py
+++ b/discord/appinfo.py
@@ -27,6 +27,9 @@ from .user import User
from .asset import Asset
from .team import Team
+__all__ = (
+ 'AppInfo',
+)
class AppInfo:
"""Represents the application info for the bot provided by Discord.
diff --git a/discord/asset.py b/discord/asset.py
index 01e22c8b..db3b8967 100644
--- a/discord/asset.py
+++ b/discord/asset.py
@@ -27,6 +27,10 @@ from .errors import DiscordException
from .errors import InvalidArgument
from . import utils
+__all__ = (
+ 'Asset',
+)
+
VALID_STATIC_FORMATS = frozenset({"jpeg", "jpg", "webp", "png"})
VALID_AVATAR_FORMATS = VALID_STATIC_FORMATS | {"gif"}
diff --git a/discord/audit_logs.py b/discord/audit_logs.py
index ee52dcd7..745f89d1 100644
--- a/discord/audit_logs.py
+++ b/discord/audit_logs.py
@@ -29,6 +29,12 @@ from .colour import Colour
from .invite import Invite
from .mixins import Hashable
+__all__ = (
+ 'AuditLogDiff',
+ 'AuditLogChanges',
+ 'AuditLogEntry',
+)
+
def _transform_verification_level(entry, data):
return enums.try_enum(enums.VerificationLevel, data)
diff --git a/discord/backoff.py b/discord/backoff.py
index 22c15bcd..f538face 100644
--- a/discord/backoff.py
+++ b/discord/backoff.py
@@ -25,6 +25,10 @@ DEALINGS IN THE SOFTWARE.
import time
import random
+__all__ = (
+ 'ExponentialBackoff',
+)
+
class ExponentialBackoff:
"""An implementation of the exponential backoff algorithm
diff --git a/discord/client.py b/discord/client.py
index 6d80c9d8..32560099 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -52,6 +52,10 @@ from .webhook import Webhook
from .iterators import GuildIterator
from .appinfo import AppInfo
+__all__ = (
+ 'Client',
+)
+
log = logging.getLogger(__name__)
def _cancel_tasks(loop):
diff --git a/discord/colour.py b/discord/colour.py
index 3296afb7..95a70806 100644
--- a/discord/colour.py
+++ b/discord/colour.py
@@ -25,6 +25,11 @@ DEALINGS IN THE SOFTWARE.
import colorsys
import random
+__all__ = (
+ 'Colour',
+ 'Color',
+)
+
class Colour:
"""Represents a Discord role colour. This class is similar
to a (red, green, blue) :class:`tuple`.
diff --git a/discord/context_managers.py b/discord/context_managers.py
index 4cb51c1b..bb3b77ab 100644
--- a/discord/context_managers.py
+++ b/discord/context_managers.py
@@ -24,6 +24,10 @@ DEALINGS IN THE SOFTWARE.
import asyncio
+__all__ = (
+ 'Typing',
+)
+
def _typing_done_callback(fut):
# just retrieve any exception and call it a day
try:
diff --git a/discord/embeds.py b/discord/embeds.py
index 4ccf4cf9..88a8117e 100644
--- a/discord/embeds.py
+++ b/discord/embeds.py
@@ -27,6 +27,10 @@ import datetime
from . import utils
from .colour import Colour
+__all__ = (
+ 'Embed',
+)
+
class _EmptyEmbed:
def __bool__(self):
return False
diff --git a/discord/emoji.py b/discord/emoji.py
index 798edc44..02c0ddc8 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -27,6 +27,10 @@ from . import utils
from .partial_emoji import _EmojiTag
from .user import User
+__all__ = (
+ 'Emoji',
+)
+
class Emoji(_EmojiTag):
"""Represents a custom emoji.
diff --git a/discord/errors.py b/discord/errors.py
index 6e95010e..2e694318 100644
--- a/discord/errors.py
+++ b/discord/errors.py
@@ -22,6 +22,22 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
+__all__ = (
+ 'DiscordException',
+ 'ClientException',
+ 'NoMoreItems',
+ 'GatewayNotFound',
+ 'HTTPException',
+ 'Forbidden',
+ 'NotFound',
+ 'DiscordServerError',
+ 'InvalidData',
+ 'InvalidArgument',
+ 'LoginFailure',
+ 'ConnectionClosed',
+ 'PrivilegedIntentsRequired',
+)
+
class DiscordException(Exception):
"""Base exception class for discord.py
diff --git a/discord/ext/commands/__init__.py b/discord/ext/commands/__init__.py
index bfb0814a..cb866e9f 100644
--- a/discord/ext/commands/__init__.py
+++ b/discord/ext/commands/__init__.py
@@ -8,8 +8,8 @@ An extension module to facilitate creation of bot commands.
:license: MIT, see LICENSE for more details.
"""
-from .bot import Bot, AutoShardedBot, when_mentioned, when_mentioned_or
-from .context import Context
+from .bot import *
+from .context import *
from .core import *
from .errors import *
from .help import *
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index 503aa266..e421f8d9 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -39,6 +39,13 @@ from . import errors
from .help import HelpCommand, DefaultHelpCommand
from .cog import Cog
+__all__ = (
+ 'when_mentioned',
+ 'when_mentioned_or',
+ 'Bot',
+ 'AutoShardedBot',
+)
+
def when_mentioned(bot, msg):
"""A callable that implements a command prefix equivalent to being mentioned.
diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py
index 5e83b1ab..cbd28597 100644
--- a/discord/ext/commands/context.py
+++ b/discord/ext/commands/context.py
@@ -25,6 +25,10 @@ DEALINGS IN THE SOFTWARE.
import discord.abc
import discord.utils
+__all__ = (
+ 'Context',
+)
+
class Context(discord.abc.Messageable):
r"""Represents the context in which a command is being invoked under.
diff --git a/discord/ext/tasks/__init__.py b/discord/ext/tasks/__init__.py
index 57724be7..4c587e86 100644
--- a/discord/ext/tasks/__init__.py
+++ b/discord/ext/tasks/__init__.py
@@ -35,6 +35,10 @@ from discord.backoff import ExponentialBackoff
log = logging.getLogger(__name__)
+__all__ = (
+ 'loop',
+)
+
class Loop:
"""A background task helper that abstracts the loop and reconnection logic for you.
diff --git a/discord/file.py b/discord/file.py
index df83f32e..38c165d0 100644
--- a/discord/file.py
+++ b/discord/file.py
@@ -25,6 +25,10 @@ DEALINGS IN THE SOFTWARE.
import os.path
import io
+__all__ = (
+ 'File',
+)
+
class File:
r"""A parameter object used for :meth:`abc.Messageable.send`
for sending file objects.
diff --git a/discord/guild.py b/discord/guild.py
index 8883ff4a..51d2004f 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -44,6 +44,9 @@ from .asset import Asset
from .flags import SystemChannelFlags
from .integrations import Integration
+__all__ = (
+ 'Guild',
+)
BanEntry = namedtuple('BanEntry', 'reason user')
_GuildLimit = namedtuple('_GuildLimit', 'emoji bitrate filesize')
diff --git a/discord/integrations.py b/discord/integrations.py
index 8dff155e..6784f3f9 100644
--- a/discord/integrations.py
+++ b/discord/integrations.py
@@ -28,6 +28,11 @@ from .user import User
from .errors import InvalidArgument
from .enums import try_enum, ExpireBehaviour
+__all__ = (
+ 'IntegrationAccount',
+ 'Integration',
+)
+
class IntegrationAccount:
"""Represents an integration account.
diff --git a/discord/invite.py b/discord/invite.py
index d4d7d3d0..697c62d0 100644
--- a/discord/invite.py
+++ b/discord/invite.py
@@ -28,6 +28,12 @@ from .object import Object
from .mixins import Hashable
from .enums import ChannelType, VerificationLevel, try_enum
+__all__ = (
+ 'PartialInviteChannel',
+ 'PartialInviteGuild',
+ 'Invite',
+)
+
class PartialInviteChannel:
"""Represents a "partial" invite channel.
diff --git a/discord/member.py b/discord/member.py
index c51e7835..753780d9 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -39,6 +39,11 @@ from .enums import Status, try_enum
from .colour import Colour
from .object import Object
+__all__ = (
+ 'VoiceState',
+ 'Member',
+)
+
class VoiceState:
"""Represents a Discord user's voice state.
diff --git a/discord/mentions.py b/discord/mentions.py
index b100b925..5b2a32e1 100644
--- a/discord/mentions.py
+++ b/discord/mentions.py
@@ -22,6 +22,10 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
+__all__ = (
+ 'AllowedMentions',
+)
+
class _FakeBool:
def __repr__(self):
return 'True'
diff --git a/discord/mixins.py b/discord/mixins.py
index 4413a0ee..f373ecf8 100644
--- a/discord/mixins.py
+++ b/discord/mixins.py
@@ -22,6 +22,11 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
+__all__ = (
+ 'EqualityComparable',
+ 'Hashable',
+)
+
class EqualityComparable:
__slots__ = ()
diff --git a/discord/object.py b/discord/object.py
index a2ceeddb..8ea5293d 100644
--- a/discord/object.py
+++ b/discord/object.py
@@ -25,6 +25,10 @@ DEALINGS IN THE SOFTWARE.
from . import utils
from .mixins import Hashable
+__all__ = (
+ 'Object',
+)
+
class Object(Hashable):
"""Represents a generic Discord object.
diff --git a/discord/oggparse.py b/discord/oggparse.py
index a360ad90..f2a14927 100644
--- a/discord/oggparse.py
+++ b/discord/oggparse.py
@@ -26,6 +26,12 @@ import struct
from .errors import DiscordException
+__all__ = (
+ 'OggError',
+ 'OggPage',
+ 'OggStream',
+)
+
class OggError(DiscordException):
"""An exception that is thrown for Ogg stream parsing errors."""
pass
diff --git a/discord/opus.py b/discord/opus.py
index afc55175..88127f99 100644
--- a/discord/opus.py
+++ b/discord/opus.py
@@ -33,6 +33,12 @@ import sys
from .errors import DiscordException
+__all__ = (
+ 'Encoder',
+ 'OpusError',
+ 'OpusNotLoaded',
+)
+
log = logging.getLogger(__name__)
c_int_ptr = ctypes.POINTER(ctypes.c_int)
diff --git a/discord/partial_emoji.py b/discord/partial_emoji.py
index fed70db3..698feeab 100644
--- a/discord/partial_emoji.py
+++ b/discord/partial_emoji.py
@@ -25,6 +25,9 @@ DEALINGS IN THE SOFTWARE.
from .asset import Asset
from . import utils
+__all__ = (
+ 'PartialEmoji',
+)
class _EmojiTag:
__slots__ = ()
diff --git a/discord/raw_models.py b/discord/raw_models.py
index 535a4fc8..6c0b0da3 100644
--- a/discord/raw_models.py
+++ b/discord/raw_models.py
@@ -22,6 +22,15 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
"""
+__all__ = (
+ 'RawMessageDeleteEvent',
+ 'RawBulkMessageDeleteEvent',
+ 'RawMessageUpdateEvent',
+ 'RawReactionActionEvent',
+ 'RawReactionClearEvent',
+ 'RawReactionClearEmojiEvent',
+)
+
class _RawReprMixin:
def __repr__(self):
value = ' '.join(f'{attr}={getattr(self, attr)!r}' for attr in self.__slots__)
diff --git a/discord/reaction.py b/discord/reaction.py
index c1db4415..34ef5333 100644
--- a/discord/reaction.py
+++ b/discord/reaction.py
@@ -24,6 +24,10 @@ DEALINGS IN THE SOFTWARE.
from .iterators import ReactionIterator
+__all__ = (
+ 'Reaction',
+)
+
class Reaction:
"""Represents a reaction to a message.
diff --git a/discord/role.py b/discord/role.py
index 46f1ba39..37fa8f8b 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -28,6 +28,11 @@ from .colour import Colour
from .mixins import Hashable
from .utils import snowflake_time, _get_as_snowflake
+__all__ = (
+ 'RoleTags',
+ 'Role',
+)
+
class RoleTags:
"""Represents tags on a role.
diff --git a/discord/shard.py b/discord/shard.py
index ea1d3f5b..9b900338 100644
--- a/discord/shard.py
+++ b/discord/shard.py
@@ -44,6 +44,11 @@ from .errors import (
from . import utils
from .enums import Status
+__all__ = (
+ 'AutoShardedClient',
+ 'ShardInfo',
+)
+
log = logging.getLogger(__name__)
class EventType:
diff --git a/discord/sticker.py b/discord/sticker.py
index 4cf109c1..1240e357 100644
--- a/discord/sticker.py
+++ b/discord/sticker.py
@@ -27,6 +27,10 @@ from .asset import Asset
from .utils import snowflake_time
from .enums import StickerType, try_enum
+__all__ = (
+ 'Sticker',
+)
+
class Sticker(Hashable):
"""Represents a sticker
diff --git a/discord/user.py b/discord/user.py
index 670ce6d2..8b134b40 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -29,6 +29,11 @@ from .enums import DefaultAvatar, try_enum
from .colour import Colour
from .asset import Asset
+__all__ = (
+ 'User',
+ 'ClientUser',
+)
+
_BaseUser = discord.abc.User
class BaseUser(_BaseUser):
diff --git a/discord/utils.py b/discord/utils.py
index 03478b3f..2f151be1 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -39,6 +39,18 @@ import warnings
from .errors import InvalidArgument
+__all__ = (
+ 'oauth_uri',
+ 'snowflake_time',
+ 'time_snowflake',
+ 'find',
+ 'get',
+ 'sleep_until',
+ 'utcnow',
+ 'remove_markdown',
+ 'escape_markdown',
+ 'escape_mentions',
+)
DISCORD_EPOCH = 1420070400000
class cached_property:
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 9a170198..d3540e0e 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -55,6 +55,11 @@ try:
except ImportError:
has_nacl = False
+__all__ = (
+ 'VoiceProtocol',
+ 'VoiceClient',
+)
+
log = logging.getLogger(__name__)
class VoiceProtocol:
diff --git a/discord/widget.py b/discord/widget.py
index 7f3ed4c8..6a7a8adf 100644
--- a/discord/widget.py
+++ b/discord/widget.py
@@ -28,6 +28,12 @@ from .activity import create_activity
from .invite import Invite
from .enums import Status, try_enum
+__all__ = (
+ 'WidgetChannel',
+ 'WidgetMember',
+ 'Widget',
+)
+
class WidgetChannel:
"""Represents a "partial" widget channel.