refactor(discord): simplify native command auth selection · openclaw/openclaw@c151956
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -249,15 +249,12 @@ function resolveDiscordGuildNativeCommandAuthorized(params: {
|
249 | 249 | allowed: policyAuthorizer.allowed, |
250 | 250 | }; |
251 | 251 | const fallbackAuthorizers = [policyFallbackAuthorizer, ownerAuthorizer, memberAuthorizer]; |
| 252 | +const authorizers = params.commandsAllowFromAccess.configured |
| 253 | + ? [commandAllowlistAuthorizer] |
| 254 | + : fallbackAuthorizers; |
252 | 255 | return resolveCommandAuthorizedFromAuthorizers({ |
253 | 256 | useAccessGroups: params.useAccessGroups, |
254 | | -authorizers: params.useAccessGroups |
255 | | - ? params.commandsAllowFromAccess.configured |
256 | | - ? [commandAllowlistAuthorizer] |
257 | | - : fallbackAuthorizers |
258 | | - : params.commandsAllowFromAccess.configured |
259 | | - ? [commandAllowlistAuthorizer] |
260 | | - : fallbackAuthorizers, |
| 257 | + authorizers, |
261 | 258 | modeWhenAccessGroupsOff: "configured", |
262 | 259 | }); |
263 | 260 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。