mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Added ping when replypinging
This commit is contained in:
parent
e20dca4252
commit
98333c7982
1 changed files with 11 additions and 1 deletions
|
|
@ -148,11 +148,21 @@ public class ProxyService
|
|||
{
|
||||
// Create reply embed
|
||||
var embeds = new List<Embed>();
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue