mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
fix permission thingy
This commit is contained in:
parent
72e1269a7f
commit
8b877f4740
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue