[JSON] Write user color (#552)

pull/554/head
rtm516 4 years ago committed by GitHub
parent c64133f717
commit 2fea455c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -230,6 +230,7 @@ namespace DiscordChatExporter.Core.Exporting.Writers
_writer.WriteString("name", message.Author.Name); _writer.WriteString("name", message.Author.Name);
_writer.WriteString("discriminator", message.Author.DiscriminatorFormatted); _writer.WriteString("discriminator", message.Author.DiscriminatorFormatted);
_writer.WriteString("nickname", Context.TryGetMember(message.Author.Id)?.Nick ?? message.Author.Name); _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.WriteBoolean("isBot", message.Author.IsBot);
_writer.WriteString("avatarUrl", await Context.ResolveMediaUrlAsync(message.Author.AvatarUrl)); _writer.WriteString("avatarUrl", await Context.ResolveMediaUrlAsync(message.Author.AvatarUrl));
_writer.WriteEndObject(); _writer.WriteEndObject();

Loading…
Cancel
Save