From 107c9de2655f752a7c5b7468b890210c85341434 Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Fri, 27 Oct 2017 22:42:12 +0300 Subject: [PATCH] Add message type to message object --- DiscordChatExporter/Models/Message.cs | 5 ++++- DiscordChatExporter/Services/DataService.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DiscordChatExporter/Models/Message.cs b/DiscordChatExporter/Models/Message.cs index 2ce20f6..aff310b 100644 --- a/DiscordChatExporter/Models/Message.cs +++ b/DiscordChatExporter/Models/Message.cs @@ -7,6 +7,8 @@ namespace DiscordChatExporter.Models { public string Id { get; } + public MessageType Type { get; } + public User Author { get; } public DateTime TimeStamp { get; } @@ -23,13 +25,14 @@ namespace DiscordChatExporter.Models public IReadOnlyList MentionedChannels { get; } - public Message(string id, User author, + public Message(string id, MessageType type, User author, DateTime timeStamp, DateTime? editedTimeStamp, string content, IReadOnlyList attachments, IReadOnlyList mentionedUsers, IReadOnlyList mentionedRoles, IReadOnlyList mentionedChannels) { Id = id; + Type = type; Author = author; TimeStamp = timeStamp; EditedTimeStamp = editedTimeStamp; diff --git a/DiscordChatExporter/Services/DataService.cs b/DiscordChatExporter/Services/DataService.cs index 8f82c92..43affdd 100644 --- a/DiscordChatExporter/Services/DataService.cs +++ b/DiscordChatExporter/Services/DataService.cs @@ -289,7 +289,7 @@ namespace DiscordChatExporter.Services .Select(i => channels.GetOrDefault(i) ?? new Channel(i, "deleted-channel", ChannelType.GuildTextChat)) .ToArray(); - return new Message(id, author, timeStamp, editedTimeStamp, content, attachments, + return new Message(id, type, author, timeStamp, editedTimeStamp, content, attachments, mentionedUsers, mentionedRoles, mentionedChanenls); } }