From ae77515c50136ad40b6f0a81fb02f355df48a58d Mon Sep 17 00:00:00 2001 From: LordOfPolls Date: Thu, 22 Jun 2023 09:10:34 +0100 Subject: [PATCH] feat: support media channels --- interactions/models/discord/channel.py | 7 +++++++ interactions/models/discord/enums.py | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/interactions/models/discord/channel.py b/interactions/models/discord/channel.py index 26e8200ac..b052b18b0 100644 --- a/interactions/models/discord/channel.py +++ b/interactions/models/discord/channel.py @@ -2640,6 +2640,11 @@ async def delete_tag(self, tag_id: "Snowflake_Type") -> None: self._client.cache.place_channel_data(data) +@attrs.define(eq=False, order=False, hash=False, kw_only=True) +class GuildMediaChannel(GuildForum): + ... + + def process_permission_overwrites( overwrites: Union[dict, PermissionOverwrite, List[Union[dict, PermissionOverwrite]]] ) -> List[dict]: @@ -2694,6 +2699,7 @@ def process_permission_overwrites( GuildVoice, GuildStageVoice, GuildForum, + GuildMediaChannel, GuildPublicThread, GuildForumPost, GuildPrivateThread, @@ -2731,4 +2737,5 @@ def process_permission_overwrites( ChannelType.DM: DM, ChannelType.GROUP_DM: DMGroup, ChannelType.GUILD_FORUM: GuildForum, + ChannelType.MEDIA_CHANNEL: GuildMediaChannel, } diff --git a/interactions/models/discord/enums.py b/interactions/models/discord/enums.py index 69e1cfbee..c93fea6bd 100644 --- a/interactions/models/discord/enums.py +++ b/interactions/models/discord/enums.py @@ -611,6 +611,8 @@ class ChannelType(CursedIntEnum): """Voice channel for hosting events with an audience""" GUILD_FORUM = 15 """A Forum channel""" + MEDIA_CHANNEL = 16 + """Channel that can only contain threads, similar to `GUILD_FORUM` channels""" @property def guild(self) -> bool: @@ -794,6 +796,8 @@ class ChannelFlags(DiscordIntFlag): """ Thread is pinned to the top of its parent forum channel """ CLYDE_THREAD = 1 << 8 """This thread was created by Clyde""" + HIDE_MEDIA_DOWNLOAD_OPTIONS = 1 << 15 + """when set hides the embedded media download options. Available only for media channels""" # Special members NONE = 0