Inheritance: Discord.WebSocket.SocketGuildChannel, ICategoryChannel
コード例 #1
0
        internal new static SocketCategoryChannel Create(SocketGuild guild, ClientState state, Model model)
        {
            var entity = new SocketCategoryChannel(guild.Discord, model.Id, guild);

            entity.Update(state, model);
            return(entity);
        }
コード例 #2
0
 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),
     });
コード例 #3
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));
            }
        }
コード例 #4
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));
            }
        }
コード例 #5
0
 /// <summary>
 /// Converts an existing <see cref="SocketCategoryChannel"/> to an abstracted <see cref="ISocketCategoryChannel"/> value.
 /// </summary>
 /// <param name="socketCategoryChannel">The existing <see cref="SocketCategoryChannel"/> to be abstracted.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="socketCategoryChannel"/>.</exception>
 /// <returns>An <see cref="ISocketCategoryChannel"/> that abstracts <paramref name="socketCategoryChannel"/>.</returns>
 public static ISocketCategoryChannel Abstract(SocketCategoryChannel socketCategoryChannel)
 => new SocketCategoryChannelAbstraction(socketCategoryChannel);
コード例 #6
0
 /// <summary>
 /// Constructs a new <see cref="SocketCategoryChannelAbstraction"/> around an existing <see cref="WebSocket.SocketCategoryChannel"/>.
 /// </summary>
 /// <param name="socketCategoryChannel">The value to use for <see cref="WebSocket.SocketCategoryChannel"/>.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="socketCategoryChannel"/>.</exception>
 public SocketCategoryChannelAbstraction(SocketCategoryChannel socketCategoryChannel)
     : base(socketCategoryChannel)
 {
 }