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,
|
scope,
|
||||||
} = params;
|
} = params;
|
||||||
const channels = guildInfo?.channels;
|
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 resolvedParentSlug = parentSlug ?? (parentName ? normalizeDiscordSlug(parentName) : "");
|
||||||
const match = resolveDiscordChannelEntryMatch(
|
const match = resolveDiscordChannelEntryMatch(
|
||||||
channels,
|
channels,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user