From 98333c7982e97c2ed66e15d9bda4cb065396b7af Mon Sep 17 00:00:00 2001 From: tauchner <7229@htl.rennweg.at> Date: Sun, 22 May 2022 10:41:46 +0200 Subject: [PATCH] Added ping when replypinging --- PluralKit.Bot/Proxy/ProxyService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Proxy/ProxyService.cs b/PluralKit.Bot/Proxy/ProxyService.cs index 1015f41d..aeaf6e87 100644 --- a/PluralKit.Bot/Proxy/ProxyService.cs +++ b/PluralKit.Bot/Proxy/ProxyService.cs @@ -148,11 +148,21 @@ public class ProxyService { // Create reply embed var embeds = new List(); + var content = ""; + if (trigger.Type == Message.MessageType.Reply && trigger.MessageReference?.ChannelId == trigger.ChannelId) { var repliedTo = trigger.ReferencedMessage.Value; if (repliedTo != null) { + if (trigger.Mentions.Length > 0 + && repliedTo.Author.Id == trigger.Mentions[0].Id + && !(trigger.Content.Contains($"<@{repliedTo.Author.Id}>") + || trigger.Content.Contains($"<@!{repliedTo.Author.Id}>"))) + { + content = $"*<@{repliedTo.Author.Id}>*\n"; + } + var (nickname, avatar) = await FetchReferencedMessageAuthorInfo(trigger, repliedTo); var embed = CreateReplyEmbed(match, trigger, repliedTo, nickname, avatar); if (embed != null) @@ -163,7 +173,7 @@ public class ProxyService } // Send the webhook - var content = match.ProxyContent; + content += match.ProxyContent; if (!allowEmbeds) content = content.BreakLinkEmbeds(); var messageChannel = await _cache.GetChannel(trigger.ChannelId);