From 2f90e7c0506cf1ee642e76dbc5e2fcfd58f9495a Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 15 Jul 2019 22:11:08 +0200 Subject: [PATCH] Show sender account in message card --- PluralKit.Bot/Services/EmbedService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index 7353afe3..5d2b6699 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -132,12 +132,16 @@ namespace PluralKit.Bot { var memberStr = $"{msg.Member.Name} (`{msg.Member.Hid}`)"; if (msg.Member.Pronouns != null) memberStr += $"\n*(pronouns: **{msg.Member.Pronouns}**)*"; + + var user = await _client.GetUserAsync(msg.Message.Sender); + var userStr = user.NameAndMention() ?? $"*(deleted user {msg.Message.Sender})*"; return new EmbedBuilder() .WithAuthor(msg.Member.Name, msg.Member.AvatarUrl) .WithDescription(serverMsg?.Content ?? "*(message contents deleted or inaccessible)*") .AddField("System", msg.System.Name != null ? $"{msg.System.Name} (`{msg.System.Hid}`)" : $"`{msg.System.Hid}`", true) .AddField("Member", memberStr, true) + .AddField("Sent by", userStr, inline: true) .WithTimestamp(SnowflakeUtils.FromSnowflake(msg.Message.Mid)) .Build(); }