mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 18:55:28 +00:00
everything borked
This commit is contained in:
parent
d224c961d8
commit
ef48350e4e
|
@ -84,8 +84,8 @@ function hasPerm(member: Member, perm: 'View'|'ManageRoles'|'ManageChannels'|'M
|
||||||
if (member.server?.owner == member.user?._id) return true;
|
if (member.server?.owner == member.user?._id) return true;
|
||||||
|
|
||||||
// this should work but im not 100% certain
|
// this should work but im not 100% certain
|
||||||
let userPerm = member.roles?.map(id => member.server?.roles?.[id])
|
let userPerm = member.roles?.map(id => member.server?.roles?.[id]?.permissions?.[0])
|
||||||
.reduce((sum: number, cur: any) => sum | cur.permissions[0], member.server?.default_permissions[0]) ?? 0;
|
.reduce((sum?: number, cur?: number) => sum! | cur!, member.server?.default_permissions[0]) ?? 0;
|
||||||
|
|
||||||
return !!(userPerm & p);
|
return !!(userPerm & p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue