From 54a592711e0331daa406f9094fdcb188e0d677ca Mon Sep 17 00:00:00 2001 From: wakingcan Date: Tue, 27 Jan 2026 01:16:40 -0600 Subject: [PATCH] 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. --- src/discord/monitor/allow-list.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/discord/monitor/allow-list.ts b/src/discord/monitor/allow-list.ts index 12c2d1d39..645847889 100644 --- a/src/discord/monitor/allow-list.ts +++ b/src/discord/monitor/allow-list.ts @@ -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,