Adds builders for Thumbnail and Image embeds, and adds json model for Video and Image embeds.

This commit is contained in:
Sindre G. Langhus
2016-11-22 22:22:16 +01:00
parent ff33b3b7a3
commit 09608b79c3
8 changed files with 201 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ namespace Discord
public string Title { get; }
public string Type { get; }
public Color? Color { get; }
public EmbedImage? Image { get; }
public EmbedVideo? Video { get; }
public EmbedAuthor? Author { get; }
public EmbedFooter? Footer { get; }
public EmbedProvider? Provider { get; }
@@ -25,6 +27,8 @@ namespace Discord
string description,
string url,
Color? color,
EmbedImage? image,
EmbedVideo? video,
EmbedAuthor? author,
EmbedFooter? footer,
EmbedProvider? provider,
@@ -36,6 +40,8 @@ namespace Discord
Description = description;
Url = url;
Color = color;
Image = image;
Video = video;
Author = author;
Footer = footer;
Provider = provider;
@@ -46,6 +52,8 @@ namespace Discord
{
return new Embed(model.Type, model.Title, model.Description, model.Url,
model.Color.HasValue ? new Color(model.Color.Value) : (Color?)null,
model.Image.IsSpecified ? EmbedImage.Create(model.Image.Value) : (EmbedImage?)null,
model.Video.IsSpecified ? EmbedVideo.Create(model.Video.Value) : (EmbedVideo?)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,