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__ = ()
_state: ConnectionState
async def _get_channel(self) -> Connectable:
return self
async def _get_channel(self) -> VocalChannel:
raise NotImplementedError
def _get_voice_client_key(self) -> Tuple[int, str]:
raise NotImplementedError

2
discord/ext/commands/cog.py

@ -459,7 +459,7 @@ class Cog(metaclass=CogMeta):
command.cog = self
if command.parent is None:
try:
bot.add_command(command)
bot.add_command(command) # type: ignore
except Exception as e:
# undo our additions
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], ...]:
"""Tuple[Union[:class:`EmojiPickerSection`, :class:`Guild`]]: A list of emoji picker sections (including guild IDs) that are collapsed."""
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
)

2
discord/voice_client.py

@ -44,7 +44,7 @@ import socket
import logging
import struct
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 .backoff import ExponentialBackoff

Loading…
Cancel
Save