From 394bd5a4718bbed29e038a8d17230935ccf50a06 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Sat, 30 May 2026 00:37:20 +0700 Subject: [PATCH] feat(moderation): skip message capture for specific channels in shouldCaptureMessageLocation --- src/moderation/messageCapture.ts | 1 + tests/moderation/messageCaptureFilter.test.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/moderation/messageCapture.ts b/src/moderation/messageCapture.ts index ce224ff..5f42ccf 100644 --- a/src/moderation/messageCapture.ts +++ b/src/moderation/messageCapture.ts @@ -34,6 +34,7 @@ export function shouldCaptureMessageLocation( message: MessageLocationInput, target: TextCaptureTarget, ): boolean { + if (message.channelId === "1310988070996414494" || message.channelId === "1265679542144467035") return false; // Skip specific channels if (!message.guildId || message.guildId !== target.guildId) return false; if (target.channelId && message.channelId !== target.channelId) return false; return true; diff --git a/tests/moderation/messageCaptureFilter.test.ts b/tests/moderation/messageCaptureFilter.test.ts index e3c292c..aba16ff 100644 --- a/tests/moderation/messageCaptureFilter.test.ts +++ b/tests/moderation/messageCaptureFilter.test.ts @@ -24,4 +24,20 @@ describe("shouldCaptureMessageLocation", () => { ), ).toBe(false); }); + + it("skips ignored channels", () => { + expect( + shouldCaptureMessageLocation( + { guildId: "guild-1", channelId: "1310988070996414494" }, + { guildId: "guild-1" }, + ), + ).toBe(false); + + expect( + shouldCaptureMessageLocation( + { guildId: "guild-1", channelId: "1265679542144467035" }, + { guildId: "guild-1" }, + ), + ).toBe(false); + }); });