From 2fea455c64c3bf4066f5f30ea5f8098b61d3ee2d Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 15 Apr 2021 17:21:16 +0100 Subject: [PATCH] [JSON] Write user color (#552) --- .../Exporting/Writers/JsonMessageWriter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs b/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs index 1da2b52..0ec3428 100644 --- a/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/Writers/JsonMessageWriter.cs @@ -230,6 +230,7 @@ namespace DiscordChatExporter.Core.Exporting.Writers _writer.WriteString("name", message.Author.Name); _writer.WriteString("discriminator", message.Author.DiscriminatorFormatted); _writer.WriteString("nickname", Context.TryGetMember(message.Author.Id)?.Nick ?? message.Author.Name); + _writer.WriteString("color", Context.TryGetUserColor(message.Author.Id)?.ToHex()); _writer.WriteBoolean("isBot", message.Author.IsBot); _writer.WriteString("avatarUrl", await Context.ResolveMediaUrlAsync(message.Author.AvatarUrl)); _writer.WriteEndObject(); @@ -300,4 +301,4 @@ namespace DiscordChatExporter.Core.Exporting.Writers await base.DisposeAsync(); } } -} \ No newline at end of file +}