Skip to content

Commit

Permalink
feat: support media channels
Browse files Browse the repository at this point in the history
  • Loading branch information
LordOfPolls committed Jun 22, 2023
1 parent 5a29624 commit ae77515
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions interactions/models/discord/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -2694,6 +2699,7 @@ def process_permission_overwrites(
GuildVoice,
GuildStageVoice,
GuildForum,
GuildMediaChannel,
GuildPublicThread,
GuildForumPost,
GuildPrivateThread,
Expand Down Expand Up @@ -2731,4 +2737,5 @@ def process_permission_overwrites(
ChannelType.DM: DM,
ChannelType.GROUP_DM: DMGroup,
ChannelType.GUILD_FORUM: GuildForum,
ChannelType.MEDIA_CHANNEL: GuildMediaChannel,
}
4 changes: 4 additions & 0 deletions interactions/models/discord/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae77515

Please sign in to comment.