This commit is contained in:
Lena Tauchner 2026-01-20 23:26:30 +00:00 committed by GitHub
commit 6a3de3f80c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,11 +213,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)
@ -228,7 +238,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.GuildId!.Value, trigger.ChannelId);