mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 16:04:33 +00:00
feat(discord): add wildcard channel config support
Add support for '*' wildcard in Discord channel configuration,
matching the existing guild-level wildcard behavior.
This allows applying default channel settings (like autoThread)
to all channels without listing each one explicitly:
guilds:
'*':
channels:
'*': { autoThread: true }
Specific channel configs still take precedence over the wildcard.
This commit is contained in:
committed by
Peter Steinberger
parent
9b47f463b7
commit
64d29b0c31
@@ -234,7 +234,14 @@ export function resolveDiscordChannelConfig(params: {
|
||||
name: channelName,
|
||||
slug: channelSlug,
|
||||
});
|
||||
if (!match.entry || !match.matchKey) return { allowed: false };
|
||||
if (!match.entry || !match.matchKey) {
|
||||
// Wildcard fallback: apply to all channels if "*" is configured
|
||||
const wildcard = channels["*"];
|
||||
if (wildcard) {
|
||||
return resolveDiscordChannelConfigEntry(wildcard, "*", "direct");
|
||||
}
|
||||
return { allowed: false };
|
||||
}
|
||||
return resolveDiscordChannelConfigEntry(match.entry, match.matchKey, "direct");
|
||||
}
|
||||
|
||||
@@ -284,6 +291,11 @@ export function resolveDiscordChannelConfigWithFallback(params: {
|
||||
match.matchSource === "parent" ? "parent" : "direct",
|
||||
);
|
||||
}
|
||||
// Wildcard fallback: apply to all channels if "*" is configured
|
||||
const wildcard = channels["*"];
|
||||
if (wildcard) {
|
||||
return resolveDiscordChannelConfigEntry(wildcard, "*", "direct");
|
||||
}
|
||||
return { allowed: false };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user