From c5704131cefd1b17da76ef179c2da81855c3fb25 Mon Sep 17 00:00:00 2001 From: Tiago R Date: Sun, 26 Nov 2023 13:44:42 +0000 Subject: [PATCH] support media channels Signed-off-by: GitHub --- backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts | 1 + backend/src/plugins/Utility/functions/getServerInfoEmbed.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts index ee006f5f..d41e3e44 100644 --- a/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getChannelInfoEmbed.ts @@ -56,6 +56,7 @@ export async function getChannelInfoEmbed( [ChannelType.AnnouncementThread]: "News Thread channel", [ChannelType.GuildDirectory]: "Hub channel", [ChannelType.GuildForum]: "Forum channel", + [ChannelType.GuildMedia]: "Media channel", }[channel.type] ?? "Channel"; embed.author = { diff --git a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts index d0202db7..afcefb80 100644 --- a/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts +++ b/backend/src/plugins/Utility/functions/getServerInfoEmbed.ts @@ -149,12 +149,16 @@ export async function getServerInfoEmbed( const textChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildText); const voiceChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildVoice); const forumChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildForum); + const mediaChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildMedia); const threadChannelsText = thisServer.channels.cache.filter( (channel) => channel.isThread() && channel.parent?.type !== ChannelType.GuildForum, ); const threadChannelsForums = thisServer.channels.cache.filter( (channel) => channel.isThread() && channel.parent?.type === ChannelType.GuildForum, ); + const threadChannelsMedia = thisServer.channels.cache.filter( + (channel) => channel.isThread() && channel.parent?.type === ChannelType.GuildMedia, + ); const announcementChannels = thisServer.channels.cache.filter( (channel) => channel.type === ChannelType.GuildAnnouncement, ); @@ -169,6 +173,7 @@ export async function getServerInfoEmbed( Categories: **${categories.size}** Text: **${textChannels.size}** (**${threadChannelsText.size} threads**) Forums: **${forumChannels.size}** (**${threadChannelsForums.size} threads**) + Media: **${mediaChannels.size}** (**${threadChannelsMedia.size} threads**) Announcement: **${announcementChannels.size}** Voice: **${voiceChannels.size}** Stage: **${stageChannels.size}**