3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

support media channels

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2023-11-26 13:44:42 +00:00
parent 1579c3ec25
commit c5704131ce
2 changed files with 6 additions and 0 deletions

View file

@ -56,6 +56,7 @@ export async function getChannelInfoEmbed(
[ChannelType.AnnouncementThread]: "News Thread channel", [ChannelType.AnnouncementThread]: "News Thread channel",
[ChannelType.GuildDirectory]: "Hub channel", [ChannelType.GuildDirectory]: "Hub channel",
[ChannelType.GuildForum]: "Forum channel", [ChannelType.GuildForum]: "Forum channel",
[ChannelType.GuildMedia]: "Media channel",
}[channel.type] ?? "Channel"; }[channel.type] ?? "Channel";
embed.author = { embed.author = {

View file

@ -149,12 +149,16 @@ export async function getServerInfoEmbed(
const textChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildText); const textChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildText);
const voiceChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildVoice); const voiceChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildVoice);
const forumChannels = thisServer.channels.cache.filter((channel) => channel.type === ChannelType.GuildForum); 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( const threadChannelsText = thisServer.channels.cache.filter(
(channel) => channel.isThread() && channel.parent?.type !== ChannelType.GuildForum, (channel) => channel.isThread() && channel.parent?.type !== ChannelType.GuildForum,
); );
const threadChannelsForums = thisServer.channels.cache.filter( const threadChannelsForums = thisServer.channels.cache.filter(
(channel) => channel.isThread() && channel.parent?.type === ChannelType.GuildForum, (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( const announcementChannels = thisServer.channels.cache.filter(
(channel) => channel.type === ChannelType.GuildAnnouncement, (channel) => channel.type === ChannelType.GuildAnnouncement,
); );
@ -169,6 +173,7 @@ export async function getServerInfoEmbed(
Categories: **${categories.size}** Categories: **${categories.size}**
Text: **${textChannels.size}** (**${threadChannelsText.size} threads**) Text: **${textChannels.size}** (**${threadChannelsText.size} threads**)
Forums: **${forumChannels.size}** (**${threadChannelsForums.size} threads**) Forums: **${forumChannels.size}** (**${threadChannelsForums.size} threads**)
Media: **${mediaChannels.size}** (**${threadChannelsMedia.size} threads**)
Announcement: **${announcementChannels.size}** Announcement: **${announcementChannels.size}**
Voice: **${voiceChannels.size}** Voice: **${voiceChannels.size}**
Stage: **${stageChannels.size}** Stage: **${stageChannels.size}**