internal static Sticker Create(BaseDiscordClient client, Model model) { var entity = new Sticker(client, model.Id); entity.Update(model); return(entity); }
internal static SocketCustomSticker Create(DiscordSocketClient client, Model model, SocketGuild guild, ulong?authorId = null) { var entity = new SocketCustomSticker(client, model.Id, guild, authorId); entity.Update(model); return(entity); }
internal static CustomSticker Create(BaseDiscordClient client, Model model, ulong guildId, ulong?authorId = null) { var entity = new CustomSticker(client, model.Id, guildId, authorId); entity.Update(model); return(entity); }
internal static SocketSticker Create(DiscordSocketClient client, Model model) { var entity = model.GuildId.IsSpecified ? new SocketCustomSticker(client, model.Id, client.GetGuild(model.GuildId.Value), model.User.IsSpecified ? model.User.Value.Id : null) : new SocketSticker(client, model.Id); entity.Update(model); return(entity); }
internal void Update(Model model) { PackId = model.PackId; Name = model.Name; Description = model.Description; Tags = model.Tags.IsSpecified ? model.Tags.Value.Split(',').Select(x => x.Trim()).ToArray() : Array.Empty <string>(); Type = model.Type; SortOrder = model.SortValue; IsAvailable = model.Available; Format = model.FormatType; }
internal virtual void Update(Model model) { Name = model.Name; Description = model.Description; PackId = model.PackId; IsAvailable = model.Available; Format = model.FormatType; Type = model.Type; SortOrder = model.SortValue; Tags = model.Tags.IsSpecified ? model.Tags.Value.Split(',').Select(x => x.Trim()).ToImmutableArray() : ImmutableArray.Create <string>(); }
internal static Sticker Create(Model model) { return(new Sticker(model.Id, model.PackId, model.Name, model.Desription, model.Tags.IsSpecified ? model.Tags.Value.Split(',') : new string[0], model.Asset, model.PreviewAsset, model.FormatType)); }