From 82713369b7fbbfea719f4e7e4bc9909c71c2070a Mon Sep 17 00:00:00 2001 From: retr0-init <146389702+retr0-init@users.noreply.github.com> Date: Mon, 26 Feb 2024 22:06:45 +0000 Subject: [PATCH 1/2] fix: Correct the return type of fetch_channels Signed-off-by: retr0-init <146389702+retr0-init@users.noreply.github.com> --- interactions/models/discord/guild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interactions/models/discord/guild.py b/interactions/models/discord/guild.py index 3b2e780be..8579bb867 100644 --- a/interactions/models/discord/guild.py +++ b/interactions/models/discord/guild.py @@ -521,7 +521,7 @@ def get_owner(self) -> "models.Member": """ return self._client.cache.get_member(self.id, self._owner_id) - async def fetch_channels(self) -> List["models.TYPE_VOICE_CHANNEL"]: + async def fetch_channels(self) -> List["models.TYPE_GUILD_CHANNEL"]: """ Fetch this guild's channels. @@ -2263,7 +2263,7 @@ def get_channels(self) -> List["models.TYPE_VOICE_CHANNEL"]: """ return [self._client.get_channel(channel_id) for channel_id in self._channel_ids] - async def fetch_channels(self, *, force: bool = False) -> List["models.TYPE_VOICE_CHANNEL"]: + async def fetch_channels(self, *, force: bool = False) -> List["models.TYPE_GUILD_CHANNEL"]: """ Gets voice and stage channels which are accessible by @everyone. Fetches the channels from API if they are not cached. From a884e64aea467ffc27a033103742b42c964ca84f Mon Sep 17 00:00:00 2001 From: retr0-init <146389702+retr0-init@users.noreply.github.com> Date: Wed, 28 Feb 2024 22:44:45 +0000 Subject: [PATCH 2/2] fix: Revert return type of fetch_channels for GuildWidget This is meant to be TYPE_VOICE_CHANNEL due to it being a GuildWidget, so this should be reverted. https://github.com/interactions-py/interactions.py/pull/1622#pullrequestreview-1902234794 Signed-off-by: retr0-init <146389702+retr0-init@users.noreply.github.com> --- interactions/models/discord/guild.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactions/models/discord/guild.py b/interactions/models/discord/guild.py index 8579bb867..43b7139f6 100644 --- a/interactions/models/discord/guild.py +++ b/interactions/models/discord/guild.py @@ -2263,7 +2263,7 @@ def get_channels(self) -> List["models.TYPE_VOICE_CHANNEL"]: """ return [self._client.get_channel(channel_id) for channel_id in self._channel_ids] - async def fetch_channels(self, *, force: bool = False) -> List["models.TYPE_GUILD_CHANNEL"]: + async def fetch_channels(self, *, force: bool = False) -> List["models.TYPE_VOICE_CHANNEL"]: """ Gets voice and stage channels which are accessible by @everyone. Fetches the channels from API if they are not cached.