diff --git a/DiscordChatExporter.Core/Services/DataService.Parsers.cs b/DiscordChatExporter.Core/Services/DataService.Parsers.cs index 5fa44bbe..4bf89db8 100644 --- a/DiscordChatExporter.Core/Services/DataService.Parsers.cs +++ b/DiscordChatExporter.Core/Services/DataService.Parsers.cs @@ -140,13 +140,21 @@ namespace DiscordChatExporter.Core.Services return new Embed(title, url, timestamp, color, author, description, fields, thumbnail, image, footer); } + private Emoji ParseEmoji(JToken json) + { + var id = json["id"]?.Value(); + var name = json["name"]?.Value(); + var isAnimated = json["animated"]?.Value() ?? false; + + return new Emoji(id, name, isAnimated); + } + private Reaction ParseReaction(JToken json) { var count = json["count"].Value(); - var emojiId = json["emoji"]["id"]?.Value(); - var emojiName = json["emoji"]["name"].Value(); + var emoji = ParseEmoji(json["emoji"]); - return new Reaction(count, emojiId, emojiName); + return new Reaction(count, emoji); } private Message ParseMessage(JToken json)