Relax parsing rules for embed fields

Closes #765
This commit is contained in:
Tyrrrz 2022-01-04 22:43:40 +02:00
parent 2156c6cd0c
commit 65ab003ff5

View file

@ -11,8 +11,8 @@ public record EmbedField(
{
public static EmbedField Parse(JsonElement json)
{
var name = json.GetProperty("name").GetNonWhiteSpaceString();
var value = json.GetProperty("value").GetNonWhiteSpaceString();
var name = json.GetProperty("name").GetNonNullString();
var value = json.GetProperty("value").GetNonNullString();
var isInline = json.GetPropertyOrNull("inline")?.GetBooleanOrNull() ?? false;
return new EmbedField(name, value, isInline);