Browse Source

Fix type issues

pull/10109/head
dolfies 2 years ago
parent
commit
5266b90383
  1. 4
      discord/abc.py
  2. 2
      discord/ext/commands/cog.py
  3. 2
      discord/settings.py
  4. 2
      discord/voice_client.py

4
discord/abc.py

@ -2102,8 +2102,8 @@ class Connectable(Protocol):
__slots__ = () __slots__ = ()
_state: ConnectionState _state: ConnectionState
async def _get_channel(self) -> Connectable: async def _get_channel(self) -> VocalChannel:
return self raise NotImplementedError
def _get_voice_client_key(self) -> Tuple[int, str]: def _get_voice_client_key(self) -> Tuple[int, str]:
raise NotImplementedError raise NotImplementedError

2
discord/ext/commands/cog.py

@ -459,7 +459,7 @@ class Cog(metaclass=CogMeta):
command.cog = self command.cog = self
if command.parent is None: if command.parent is None:
try: try:
bot.add_command(command) bot.add_command(command) # type: ignore
except Exception as e: except Exception as e:
# undo our additions # undo our additions
for to_undo in self.__cog_commands__[:index]: for to_undo in self.__cog_commands__[:index]:

2
discord/settings.py

@ -323,7 +323,7 @@ class UserSettings(_ProtoSettings):
def collapsed_emoji_picker_sections(self) -> Tuple[Union[EmojiPickerSection, Guild], ...]: def collapsed_emoji_picker_sections(self) -> Tuple[Union[EmojiPickerSection, Guild], ...]:
"""Tuple[Union[:class:`EmojiPickerSection`, :class:`Guild`]]: A list of emoji picker sections (including guild IDs) that are collapsed.""" """Tuple[Union[:class:`EmojiPickerSection`, :class:`Guild`]]: A list of emoji picker sections (including guild IDs) that are collapsed."""
return tuple( return tuple(
self._get_guild(section) if section.isdigit() else try_enum(EmojiPickerSection, section) self._get_guild(section, always_guild=True) if section.isdigit() else try_enum(EmojiPickerSection, section)
for section in self.settings.text_and_images.emoji_picker_collapsed_sections for section in self.settings.text_and_images.emoji_picker_collapsed_sections
) )

2
discord/voice_client.py

@ -44,7 +44,7 @@ import socket
import logging import logging
import struct import struct
import threading import threading
from typing import Any, Callable, List, Optional, TYPE_CHECKING, Tuple, Union from typing import Any, Callable, List, Optional, TYPE_CHECKING, Tuple
from . import opus, utils from . import opus, utils
from .backoff import ExponentialBackoff from .backoff import ExponentialBackoff

Loading…
Cancel
Save