mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-25 20:24:22 -04:00
Forgot to commit DataService.Parsers
This commit is contained in:
parent
847a05a269
commit
5161593e0f
1 changed files with 11 additions and 3 deletions
|
@ -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<string>();
|
||||
var name = json["name"]?.Value<string>();
|
||||
var isAnimated = json["animated"]?.Value<bool>() ?? false;
|
||||
|
||||
return new Emoji(id, name, isAnimated);
|
||||
}
|
||||
|
||||
private Reaction ParseReaction(JToken json)
|
||||
{
|
||||
var count = json["count"].Value<int>();
|
||||
var emojiId = json["emoji"]["id"]?.Value<string>();
|
||||
var emojiName = json["emoji"]["name"].Value<string>();
|
||||
var emoji = ParseEmoji(json["emoji"]);
|
||||
|
||||
return new Reaction(count, emojiId, emojiName);
|
||||
return new Reaction(count, emoji);
|
||||
}
|
||||
|
||||
private Message ParseMessage(JToken json)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue