diff --git a/discord/client.py b/discord/client.py index 80f2ff3..809d050 100644 --- a/discord/client.py +++ b/discord/client.py @@ -29,7 +29,7 @@ import sys import time from threading import Event -from typing import Callable, List, Literal, Optional, TypeVar, Union +from typing import Callable, List, Literal, Optional, TypeVar, Union, Dict from discord.channels import VoiceChannel @@ -42,7 +42,6 @@ from .interactions import ApplicationCommandRegistry from .internal import dispatcher from .state import ConnectionState -from .types.dict import Dict from .ui import print_banner, start_logging from .user import User from .voice import VoiceClient, has_nacl @@ -145,7 +144,7 @@ def __init__( mobile=mobile, ) self._got_gateway_bot: Event = Event() - self.cogs: dict[str, Cog] = {} + self.cogs: Dict[str, Cog] = {} self._extensions = {} self.chunk_guild_members = chunk_guild_members diff --git a/discord/events/messages.py b/discord/events/messages.py index 2591ebc..41e58fa 100644 --- a/discord/events/messages.py +++ b/discord/events/messages.py @@ -21,7 +21,7 @@ # SOFTWARE -from typing import Any, List +from typing import Any, List, Dict from ..assets import Emoji from ..channels import TextChannel @@ -83,7 +83,7 @@ class OnMessageDeleteBulk(Event): """ def process(self): - msgs: list[dict[str, Any]] = [ + msgs: List[Dict[str, Any]] = [ msg for msg in self.state.messages.get(self.data['ids']) ] messages = [Message(msg, self.state.app) for msg in msgs] diff --git a/discord/ext/cogs/__init__.py b/discord/ext/cogs/__init__.py index 39ba9b0..06bdfdd 100644 --- a/discord/ext/cogs/__init__.py +++ b/discord/ext/cogs/__init__.py @@ -3,7 +3,7 @@ ~~~~~~~~~~~~~~~~ Extension module to ensure the creation of Cogs. """ -from typing import Any, Callable, List, TypeVar +from typing import Any, Callable, List, TypeVar, Dict from ...internal import DiscordError, dispatcher @@ -17,9 +17,9 @@ class ExtensionLoadError(DiscordError): class Cog: - listeners: dict[str, Any] = {} - guild_commands: dict[str, Any] = {} - global_commands: dict[str, Any] = {} + listeners: Dict[str, Any] = {} + guild_commands: Dict[str, Any] = {} + global_commands: Dict[str, Any] = {} bot = None @property diff --git a/discord/ext/commands/context.py b/discord/ext/commands/context.py index aeb03ae..69a65af 100644 --- a/discord/ext/commands/context.py +++ b/discord/ext/commands/context.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE -from typing import Any, List, Optional, Sequence +from typing import Any, List, Optional, Sequence, Dict from ...embed import Embed from ...file import File @@ -43,7 +43,7 @@ def send( embeds: Optional[List[Embed]] = None, tts: Optional[bool] = False, allowed_mentions: Optional[allowed_mentions.MentionObject] = None, - components: List[dict[str, Any]] = None, + components: List[Dict[str, Any]] = None, component=None, ): return self.message.send( diff --git a/discord/message.py b/discord/message.py index 2965171..f0069a8 100644 --- a/discord/message.py +++ b/discord/message.py @@ -24,7 +24,7 @@ ref: https://discord.dev/resources/channel """ -from typing import Any, List, Optional, Sequence +from typing import Any, List, Optional, Sequence, Dict from discord.file import File from discord.types import allowed_mentions, embed_parse @@ -121,7 +121,7 @@ async def send( embeds: Optional[List[Embed]] = None, tts: Optional[bool] = False, allowed_mentions: Optional[allowed_mentions.MentionObject] = None, - components: List[dict[str, Any]] = None, + components: List[Dict[str, Any]] = None, component=None, ): """Sends a message to the channel currently active in @@ -181,8 +181,8 @@ async def reply( embeds: Optional[List[Embed]] = None, tts: Optional[bool] = False, allowed_mentions: Optional[allowed_mentions.MentionObject] = None, - components: List[dict[str, Any]] = None, - component: dict[str, Any] = None, + components: List[Dict[str, Any]] = None, + component: Dict[str, Any] = None, ): """Replys to the current message diff --git a/discord/state.py b/discord/state.py index c1f20a7..616c628 100644 --- a/discord/state.py +++ b/discord/state.py @@ -24,9 +24,7 @@ """ import asyncio from collections import OrderedDict -from typing import TYPE_CHECKING, Any, Callable, Coroutine, List, Tuple, TypeVar, Union - -from discord.types.dict import Dict +from typing import TYPE_CHECKING, Any, Callable, Coroutine, List, Tuple, TypeVar, Union, Dict if TYPE_CHECKING: from .client import Client @@ -184,7 +182,7 @@ def __init__(self, **options): self.loop: asyncio.AbstractEventLoop = options.get('loop', None) """The current loop""" - self._bot_presences: list[str, Any] = [] + self._bot_presences: List[str, Any] = [] """The precenses""" self._bot_status: str = 'online' @@ -193,17 +191,17 @@ def __init__(self, **options): self._bot_presence_type: int = 0 """Precense type""" - self.listeners: dict[str, List[Tuple[asyncio.Future, Callable[..., bool]]]] = {} + self.listeners: Dict[str, List[Tuple[asyncio.Future, Callable[..., bool]]]] = {} """The listeners""" self.shard_count: int = options.get('shard_count', None) """The shard count""" - self.components: dict[str, Any] = {} + self.components: Dict[str, Any] = {} self.prefixed_commands: List[Command] = [] - self.application_commands: dict[str, Any] = {} + self.application_commands: Dict[str, Any] = {} self.prefix = options.get('prefix')