From e70236b9c05b22499045d2cea6fd59771c315333 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 15 Feb 2020 00:12:46 +0100 Subject: [PATCH] Send member card on proxy query --- PluralKit.Bot/Services/ProxyService.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index 8a8a18a7..ebebfb95 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -257,7 +257,7 @@ namespace PluralKit.Bot return HandleMessageDeletionByReaction(message, reaction.UserId); case "\u2753": // Red question mark case "\u2754": // White question mark - return HandleMessageQueryByReaction(message, reaction.UserId, reaction.Emote); + return HandleMessageQueryByReaction(message, channel, reaction.UserId, reaction.Emote); case "\U0001F514": // Bell case "\U0001F6CE": // Bellhop bell case "\U0001F3D3": // Ping pong paddle (lol) @@ -290,7 +290,9 @@ namespace PluralKit.Bot await realMessage.RemoveReactionAsync(reactedEmote, user); } - private async Task HandleMessageQueryByReaction(Cacheable message, ulong userWhoReacted, IEmote reactedEmote) + private async Task HandleMessageQueryByReaction(Cacheable message, + ISocketMessageChannel channel, ulong userWhoReacted, + IEmote reactedEmote) { // Find the user who sent the reaction, so we can DM them var user = await _client.Rest.GetUserAsync(userWhoReacted); @@ -303,6 +305,7 @@ namespace PluralKit.Bot // DM them the message card try { + await user.SendMessageAsync(embed: await _embeds.CreateMemberEmbed(msg.System, msg.Member, (channel as IGuildChannel)?.Guild, LookupContext.ByNonOwner)); await user.SendMessageAsync(embed: await _embeds.CreateMessageInfoEmbed(msg)); } catch (HttpException e) when (e.DiscordCode == 50007)