Skip to content

Commit

Permalink
fix: pretty much every typing error
Browse files Browse the repository at this point in the history
closes #49
  • Loading branch information
VincentRPS committed Feb 15, 2022
1 parent 6dcb5cb commit e5a2b23
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
5 changes: 2 additions & 3 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions discord/events/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE


from typing import Any, List
from typing import Any, List, Dict

from ..assets import Emoji
from ..channels import TextChannel
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions discord/ext/cogs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions discord/ext/commands/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions discord/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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')

Expand Down

0 comments on commit e5a2b23

Please sign in to comment.