fix(discord): log ignored messages from non-allowlisted channels

Closes #30676

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
haosenwang1018
2026-03-02 04:33:30 +08:00
committed by Peter Steinberger
parent a5f0a9240f
commit 60330e011b

View File

@@ -440,12 +440,17 @@ export async function preflightDiscordMessage(
})
) {
if (params.groupPolicy === "disabled") {
logDebug(`[discord-preflight] drop: groupPolicy disabled`);
logVerbose(`discord: drop guild message (groupPolicy: disabled, ${channelMatchMeta})`);
} else if (!channelAllowlistConfigured) {
logDebug(`[discord-preflight] drop: groupPolicy allowlist, no channel allowlist configured`);
logVerbose(
`discord: drop guild message (groupPolicy: allowlist, no channel allowlist, ${channelMatchMeta})`,
);
} else {
logDebug(
`[discord] Ignored message from channel ${messageChannelId} (not in guild allowlist). Add to guilds.<guildId>.channels to enable.`,
);
logVerbose(
`Blocked discord channel ${messageChannelId} not in guild channel allowlist (groupPolicy: allowlist, ${channelMatchMeta})`,
);