Create() static private method

static private Create ( Discord.WebSocket.SocketGuild guild, Discord.WebSocket.ClientState state, Discord.API.Channel model ) : SocketCategoryChannel
guild Discord.WebSocket.SocketGuild
state Discord.WebSocket.ClientState
model Discord.API.Channel
return SocketCategoryChannel
 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.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:
                // TODO: Proper implementation for channel categories
                return(new SocketGuildChannel(guild.Discord, model.Id, guild));
            }
        }
Esempio n. 3
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));
            }
        }