Add support for reactions (#62)

This commit is contained in:
IntriguingTiles
2018-06-25 15:27:45 -06:00
committed by Alexey Golub
parent 61dce7c1a8
commit e8436faf66
7 changed files with 85 additions and 2 deletions

View File

@@ -25,11 +25,13 @@ namespace DiscordChatExporter.Core.Models
public IReadOnlyList<Embed> Embeds { get; }
public IReadOnlyList<Reaction> Reactions { get; }
public IReadOnlyList<User> MentionedUsers { get; }
public Message(string id, string channelId, MessageType type, User author, DateTime timestamp,
DateTime? editedTimestamp, string content, IReadOnlyList<Attachment> attachments,
IReadOnlyList<Embed> embeds, IReadOnlyList<User> mentionedUsers)
IReadOnlyList<Embed> embeds, IReadOnlyList<Reaction> reactions, IReadOnlyList<User> mentionedUsers)
{
Id = id;
ChannelId = channelId;
@@ -40,6 +42,7 @@ namespace DiscordChatExporter.Core.Models
Content = content;
Attachments = attachments;
Embeds = embeds;
Reactions = reactions;
MentionedUsers = mentionedUsers;
}

View File

@@ -0,0 +1,26 @@
using System;
namespace DiscordChatExporter.Core.Models
{
public class Reaction
{
public int Count { get; }
public bool Me { get; }
public string Id { get; }
public string Name { get; }
public string Emoji { get; }
public Reaction(int count, bool me, string id, string name)
{
Count = count;
Me = me;
Id = id;
Name = name;
Emoji = (id == "" ? name : $"<:{name}:{id}>");
}
}
}