refactor(discord): simplify native command auth selection

This commit is contained in:
Peter Steinberger
2026-04-23 19:47:06 +01:00
parent 1f06073fe8
commit c151956782

View File

@@ -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",
});
}