fix permission thingy

This commit is contained in:
JandereDev 2022-02-06 12:02:26 +01:00
parent 72e1269a7f
commit 8b877f4740
Signed by: Lea
GPG key ID: 5D5E18ACB990F57A

View file

@ -106,12 +106,11 @@ async function getPermissionLevel(user: User|Member, server: Server): Promise<0|
if (user instanceof Member) user = user.user!;
if (hasPerm(member, 'ManageServer')) return 3;
if (hasPerm(member, 'KickMembers')) return 1;
const config = (await client.db.get('servers').findOne({ id: server._id }) || {}) as ServerConfig;
if (config.botManagers?.includes(user._id)) return 2;
if (config.moderators?.includes(user._id)) return 1;
if (config.moderators?.includes(user._id) || hasPerm(member, 'KickMembers')) return 1;
return 0;
}