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:
parent
8b8fce5371
commit
54a592711e
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user