Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support media channels #1458

Merged
merged 4 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
LordOfPolls marked this conversation as resolved.
Show resolved Hide resolved
}
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
LordOfPolls marked this conversation as resolved.
Show resolved Hide resolved
"""Channel that can only contain threads, similar to `GUILD_FORUM` channels"""
LordOfPolls marked this conversation as resolved.
Show resolved Hide resolved

@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