Add various property validation in EmbedBuilder (#711)

* Add various property validation in EmbedBuilder

* Embed URI changes

Changes property types for any URLs in Embeds to System.URI.
Adding field name/value null/empty checks.

* including property names in argumentexceptions

* Adds overall embed length check
This commit is contained in:
Pat Murphy
2017-06-23 07:29:55 -07:00
committed by RogueException
parent 5f04e2beba
commit 5601d00285
16 changed files with 163 additions and 69 deletions

View File

@@ -1,4 +1,5 @@
#pragma warning disable CS1591
using System;
using Newtonsoft.Json;
namespace Discord.API
@@ -6,9 +7,9 @@ namespace Discord.API
internal class EmbedImage
{
[JsonProperty("url")]
public string Url { get; set; }
public Uri Url { get; set; }
[JsonProperty("proxy_url")]
public string ProxyUrl { get; set; }
public Uri ProxyUrl { get; set; }
[JsonProperty("height")]
public Optional<int> Height { get; set; }
[JsonProperty("width")]