fix: add EmbedTypeConverter with unknown handling
Prevents messages with an unknown EmbedType from failing to unmarshal
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma warning disable CS1591
|
||||
#pragma warning disable CS1591
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Discord.Net.Converters;
|
||||
|
||||
namespace Discord.API
|
||||
{
|
||||
@@ -15,7 +15,7 @@ namespace Discord.API
|
||||
public string Url { get; set; }
|
||||
[JsonProperty("color")]
|
||||
public uint? Color { get; set; }
|
||||
[JsonProperty("type"), JsonConverter(typeof(StringEnumConverter))]
|
||||
[JsonProperty("type"), JsonConverter(typeof(EmbedTypeConverter))]
|
||||
public EmbedType Type { get; set; }
|
||||
[JsonProperty("timestamp")]
|
||||
public DateTimeOffset? Timestamp { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user