Fixed an issue with embed array not building if the color is invalid or unspecified

This commit is contained in:
Kwoth
2022-05-01 19:20:48 +02:00
parent f132aa2624
commit 5cb95cf94d

View File

@@ -20,7 +20,10 @@ public sealed record SmartEmbedArrayElementText : SmartEmbedTextBase
protected override EmbedBuilder GetEmbedInternal() protected override EmbedBuilder GetEmbedInternal()
{ {
var embed = base.GetEmbedInternal(); var embed = base.GetEmbedInternal();
return embed.WithColor(Rgba32.ParseHex(Color).ToDiscordColor()); if (Rgba32.TryParseHex(Color, out var color))
return embed.WithColor(color.ToDiscordColor());
return embed;
} }
} }