public EmbedBuilder() { _model = new Embed { Type = "rich" }; _fields = new List <Field>(); }
internal static Embed Create(Model model) { return(new Embed(model.Type, model.Title, model.Description, model.Url, model.Color.HasValue ? new Color(model.Color.Value) : (Color?)null, model.Author.IsSpecified ? EmbedAuthor.Create(model.Author.Value) : (EmbedAuthor?)null, model.Footer.IsSpecified ? EmbedFooter.Create(model.Footer.Value) : (EmbedFooter?)null, model.Provider.IsSpecified ? EmbedProvider.Create(model.Provider.Value) : (EmbedProvider?)null, model.Thumbnail.IsSpecified ? EmbedThumbnail.Create(model.Thumbnail.Value) : (EmbedThumbnail?)null, model.Fields.IsSpecified ? model.Fields.Value.Select(x => EmbedField.Create(x)).ToImmutableArray() : ImmutableArray.Create <EmbedField>())); }
public async Task <IUserMessage> SendMessageAsync(string text, bool isTTS, Discord.API.Embed embed = null) { var args = new CreateMessageParams(text) { Content = text, IsTTS = isTTS, Embed = embed }; var model = await Discord.ApiClient.CreateDMMessageAsync(Id, args).ConfigureAwait(false); return(CreateOutgoingMessage(model)); }
public Embed(Model model) { Url = model.Url; Type = model.Type; Title = model.Title; Description = model.Description; if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Thumbnail.IsSpecified) { Thumbnail = new EmbedThumbnail(model.Thumbnail.Value); } }
public Embed(Model model) { Url = model.Url; Type = model.Type; Title = model.Title; Description = model.Description; Color = model.Color.Value; Timestamp = model.Timestamp.Value; if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Provider.IsSpecified) { Provider = new EmbedProvider(model.Provider.Value); } if (model.Thumbnail.IsSpecified) { Thumbnail = new EmbedThumbnail(model.Thumbnail.Value); } if (model.Author.IsSpecified) { Author = new EmbedAuthor(model.Author.Value); } if (model.Image.IsSpecified) { Image = EmbedImage.Create(model.Image.Value); } if (model.Video.IsSpecified) { Video = EmbedVideo.Create(model.Video.Value); } if (model.Footer.IsSpecified) { Footer = new EmbedFooter(model.Footer.Value); } if (model.Fields.IsSpecified) { Fields = model.Fields.Value.Select(EmbedField.Create).ToImmutableArray(); } else { Fields = ImmutableArray.Create <EmbedField>(); } }