diff --git a/discord/channel.py b/discord/channel.py index 48661718d..01c272626 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -3898,10 +3898,12 @@ class DMChannel(discord.abc.Messageable, discord.abc.Connectable, discord.abc.Pr A voice client that is fully connected to the voice server. """ await self._get_channel() + ret = await super().connect(timeout=timeout, reconnect=reconnect, cls=cls) + call = self.call if call is None and ring: await self._initial_ring() - return await super().connect(timeout=timeout, reconnect=reconnect, cls=cls) + return ret async def accept(self) -> DMChannel: """|coro| @@ -4469,10 +4471,12 @@ class GroupChannel(discord.abc.Messageable, discord.abc.Connectable, discord.abc ring: bool = True, ) -> T: await self._get_channel() + ret = await super().connect(timeout=timeout, reconnect=reconnect, cls=cls) + call = self.call if call is None and ring: await self._initial_ring() - return await super().connect(timeout=timeout, reconnect=reconnect, cls=cls) + return ret class PartialMessageable(discord.abc.Messageable, Hashable): diff --git a/discord/message.py b/discord/message.py index 593a3ff64..341fb0283 100644 --- a/discord/message.py +++ b/discord/message.py @@ -47,8 +47,6 @@ from typing import ( overload, ) -from discord.types.components import MessageActionRow - from . import utils from .reaction import Reaction from .emoji import Emoji @@ -563,7 +561,7 @@ class MessageSnapshot(Hashable): self.flags: MessageFlags = MessageFlags._from_value(data.get('flags', 0)) self.stickers: List[StickerItem] = [StickerItem(data=d, state=state) for d in data.get('sticker_items', [])] - self.components: List[MessageActionRow] = [] + self.components: List[ComponentPayload] = [] for component_data in data.get('components', []): component = _component_factory(component_data) if component is not None: diff --git a/discord/types/voice.py b/discord/types/voice.py index 864be9a20..66eb2518b 100644 --- a/discord/types/voice.py +++ b/discord/types/voice.py @@ -76,7 +76,7 @@ class VoiceRegion(TypedDict): class VoiceServerUpdate(TypedDict): token: str - guild_id: NotRequired[Snowflake] + guild_id: Optional[Snowflake] channel_id: Snowflake endpoint: Optional[str] diff --git a/discord/user.py b/discord/user.py index d9e2ca025..6fe132b1a 100644 --- a/discord/user.py +++ b/discord/user.py @@ -1142,10 +1142,12 @@ class User(BaseUser, discord.abc.Connectable, discord.abc.Messageable): ring: bool = True, ) -> ConnectReturn: channel = await self._get_channel() + ret = await super().connect(timeout=timeout, reconnect=reconnect, cls=cls, _channel=channel) + call = channel.call if call is None and ring: await channel._initial_ring() - return await super().connect(timeout=timeout, reconnect=reconnect, cls=cls, _channel=channel) + return ret async def create_dm(self) -> DMChannel: """|coro| diff --git a/discord/voice_state.py b/discord/voice_state.py index 4a25d81d4..7737ed8fa 100644 --- a/discord/voice_state.py +++ b/discord/voice_state.py @@ -312,7 +312,7 @@ class VoiceConnectionState: previous_endpoint = self.endpoint self.token = data['token'] - self.server_id = int(data.get('guild_id', data['channel_id'])) + self.server_id = int(data.get('guild_id') or data['channel_id']) endpoint = data.get('endpoint') if self.token is None or endpoint is None: