fix(discord): allow all channels when no channel allowlist is configured

When a guild is in the allowlist but has no channels configured,
all channels should be allowed. Previously, an empty channels object
({}) would cause channelConfig to return {allowed: false}, blocking
all messages.

Now the code checks for both null/undefined AND empty object,
returning null in both cases which results in channelAllowed=true.
This commit is contained in:
wakingcan 2026-01-27 01:16:40 -06:00
parent 8b8fce5371
commit 54a592711e

View File

@ -258,7 +258,8 @@ export function resolveDiscordChannelConfigWithFallback(params: {
scope,
} = params;
const channels = guildInfo?.channels;
if (!channels) return null;
// Return null if channels is undefined, null, or empty object - allows all channels when no allowlist is configured
if (!channels || Object.keys(channels).length === 0) return null;
const resolvedParentSlug = parentSlug ?? (parentName ? normalizeDiscordSlug(parentName) : "");
const match = resolveDiscordChannelEntryMatch(
channels,