Browse Source

Adding missing WithVideoUrl method for EmbedBuilder

pull/837/head
Ilddor 8 years ago
parent
commit
5b8b5b17b9
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs

+ 14
- 0
src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs View File

@@ -66,6 +66,15 @@ namespace Discord
_embed.Image = new EmbedImage(value, null, null, null);
}
}
public string VideoUrl
{
get => _embed.Video?.Url;
set
{
if (!value.IsNullOrUri()) throw new ArgumentException("Url must be a well-formed URI", nameof(VideoUrl));
_embed.Video = new EmbedVideo(value, null, null);
}
}
public DateTimeOffset? Timestamp { get => _embed.Timestamp; set { _embed.Timestamp = value; } }
public Color? Color { get => _embed.Color; set { _embed.Color = value; } }

@@ -109,6 +118,11 @@ namespace Discord
ImageUrl = imageUrl;
return this;
}
public EmbedBuilder WithVideoUrl(string videoUrl)
{
VideoUrl = videoUrl;
return this;
}
public EmbedBuilder WithCurrentTimestamp()
{
Timestamp = DateTimeOffset.UtcNow;


Loading…
Cancel
Save