mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-11 17:33:03 +00:00
Add support for reactions (#62)
This commit is contained in:
committed by
Alexey Golub
parent
61dce7c1a8
commit
e8436faf66
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
26
DiscordChatExporter.Core/Models/Reaction.cs
Normal file
26
DiscordChatExporter.Core/Models/Reaction.cs
Normal 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}>");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user