everything borked
This commit is contained in:
parent
d224c961d8
commit
ef48350e4e
1 changed files with 3 additions and 3 deletions
|
@ -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