mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:50:45 +00:00
refactor(discord): simplify native command auth selection
This commit is contained in:
@@ -249,15 +249,12 @@ function resolveDiscordGuildNativeCommandAuthorized(params: {
|
||||
allowed: policyAuthorizer.allowed,
|
||||
};
|
||||
const fallbackAuthorizers = [policyFallbackAuthorizer, ownerAuthorizer, memberAuthorizer];
|
||||
const authorizers = params.commandsAllowFromAccess.configured
|
||||
? [commandAllowlistAuthorizer]
|
||||
: fallbackAuthorizers;
|
||||
return resolveCommandAuthorizedFromAuthorizers({
|
||||
useAccessGroups: params.useAccessGroups,
|
||||
authorizers: params.useAccessGroups
|
||||
? params.commandsAllowFromAccess.configured
|
||||
? [commandAllowlistAuthorizer]
|
||||
: fallbackAuthorizers
|
||||
: params.commandsAllowFromAccess.configured
|
||||
? [commandAllowlistAuthorizer]
|
||||
: fallbackAuthorizers,
|
||||
authorizers,
|
||||
modeWhenAccessGroupsOff: "configured",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user