refactor: use .env STAFF instead of global config owners for global commands

This commit is contained in:
Dragory 2022-08-06 21:31:13 +03:00
parent 91f54424ed
commit f7fede47bd
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
14 changed files with 27 additions and 23 deletions

View file

@ -14,6 +14,7 @@ import { TZeppelinKnub } from "./types";
import { deepKeyIntersect, errorMessage, successMessage, tDeepPartial, tNullable } from "./utils";
import { Tail } from "./utils/typeUtils";
import { decodeAndValidateStrict, StrictValidationError, validate } from "./validatorUtils";
import { isStaff } from "./staff";
const { getMemberLevel } = helpers;
@ -242,8 +243,8 @@ export function isOwner(pluginData: AnyPluginData<any>, userId: string) {
return owners.includes(userId);
}
export const isOwnerPreFilter = (_, context: CommandContext<any>) => {
return isOwner(context.pluginData, context.message.author.id);
export const isStaffPreFilter = (_, context: CommandContext<any>) => {
return isStaff(context.message.author.id);
};
type AnyFn = (...args: any[]) => any;