fix(backend): ignore proxied messages if the original is ignored

This commit is contained in:
sam 2025-03-14 20:29:01 +01:00
parent cb43ac1a50
commit 84c3b42874
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
2 changed files with 29 additions and 6 deletions

View file

@ -18,7 +18,6 @@ using Catalogger.Backend.Database.Repositories;
using Catalogger.Backend.Extensions;
using Catalogger.Backend.Services;
using Humanizer;
using NodaTime;
using Remora.Discord.API;
using Remora.Discord.API.Abstractions.Gateway.Events;
using Remora.Discord.API.Abstractions.Objects;
@ -27,7 +26,6 @@ using Remora.Discord.Extensions.Embeds;
using Remora.Discord.Gateway.Responders;
using Remora.Rest.Core;
using Remora.Results;
using Serilog.Context;
namespace Catalogger.Backend.Bot.Responders.Messages;
@ -38,7 +36,6 @@ public class MessageDeleteResponder(
WebhookExecutorService webhookExecutor,
ChannelCache channelCache,
UserCache userCache,
IClock clock,
PluralkitApiService pluralkitApi
) : IResponder<IMessageDelete>
{
@ -81,8 +78,8 @@ public class MessageDeleteResponder(
new Embed(
Title: "Message deleted",
Description: $"A message not found in the database was deleted in <#{evt.ChannelID}> ({evt.ChannelID}).",
Footer: new EmbedFooter(Text: $"ID: {evt.ID}"),
Timestamp: clock.GetCurrentInstant().ToDateTimeOffset()
Footer: new EmbedFooter(Text: $"ID: {evt.ID} | Original sent at"),
Timestamp: evt.ID.Timestamp
)
);
@ -124,7 +121,7 @@ public class MessageDeleteResponder(
.WithTitle("Message deleted")
.WithDescription(msg.Content)
.WithColour(DiscordUtils.Red)
.WithFooter($"ID: {msg.Id}")
.WithFooter($"ID: {msg.Id} | Original sent at")
.WithTimestamp(evt.ID);
if (user != null)