Ejemplo n.º 1
0
        internal new static RestNewsChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
        {
            var entity = new RestNewsChannel(discord, guild, model.Id);

            entity.Update(model);
            return(entity);
        }
Ejemplo n.º 2
0
 internal static RestGuildChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
 {
     return(model.Type switch
     {
         ChannelType.News => RestNewsChannel.Create(discord, guild, model),
         ChannelType.Text => RestTextChannel.Create(discord, guild, model),
         ChannelType.Voice => RestVoiceChannel.Create(discord, guild, model),
         ChannelType.Stage => RestStageChannel.Create(discord, guild, model),
         ChannelType.Category => RestCategoryChannel.Create(discord, guild, model),
         ChannelType.PublicThread or ChannelType.PrivateThread or ChannelType.NewsThread => RestThreadChannel.Create(discord, guild, model),
         _ => new RestGuildChannel(discord, guild, model.Id),
     });
Ejemplo n.º 3
0
        internal static RestGuildChannel Create(BaseDiscordClient discord, IGuild guild, Model model)
        {
            switch (model.Type)
            {
            case ChannelType.News:
                return(RestNewsChannel.Create(discord, guild, model));

            case ChannelType.Text:
                return(RestTextChannel.Create(discord, guild, model));

            case ChannelType.Voice:
                return(RestVoiceChannel.Create(discord, guild, model));

            case ChannelType.Category:
                return(RestCategoryChannel.Create(discord, guild, model));

            default:
                return(new RestGuildChannel(discord, guild, model.Id));
            }
        }