internal static SocketGuildChannel Create(SocketGuild guild, ClientState state, Model model)
 {
     return(model.Type switch
     {
         ChannelType.News => SocketNewsChannel.Create(guild, state, model),
         ChannelType.Text => SocketTextChannel.Create(guild, state, model),
         ChannelType.Voice => SocketVoiceChannel.Create(guild, state, model),
         ChannelType.Category => SocketCategoryChannel.Create(guild, state, model),
         ChannelType.PrivateThread or ChannelType.PublicThread or ChannelType.NewsThread => SocketThreadChannel.Create(guild, state, model),
         ChannelType.Stage => SocketStageChannel.Create(guild, state, model),
         _ => new SocketGuildChannel(guild.Discord, model.Id, guild),
     });
Esempio n. 2
0
        internal static SocketGuildChannel Create(SocketGuild guild, ClientState state, Model model)
        {
            switch (model.Type)
            {
            case ChannelType.News:
                return(SocketNewsChannel.Create(guild, state, model));

            case ChannelType.Text:
                return(SocketTextChannel.Create(guild, state, model));

            case ChannelType.Voice:
                return(SocketVoiceChannel.Create(guild, state, model));

            case ChannelType.Category:
                return(SocketCategoryChannel.Create(guild, state, model));

            default:
                return(new SocketGuildChannel(guild.Discord, model.Id, guild));
            }
        }