everything borked
This commit is contained in:
parent
d224c961d8
commit
ef48350e4e
1 changed files with 3 additions and 3 deletions
|
@ -84,9 +84,9 @@ function hasPerm(member: Member, perm: 'View'|'ManageRoles'|'ManageChannels'|'M
|
|||
if (member.server?.owner == member.user?._id) return true;
|
||||
|
||||
// this should work but im not 100% certain
|
||||
let userPerm = member.roles?.map(id => member.server?.roles?.[id])
|
||||
.reduce((sum: number, cur: any) => sum | cur.permissions[0], member.server?.default_permissions[0]) ?? 0;
|
||||
|
||||
let userPerm = member.roles?.map(id => member.server?.roles?.[id]?.permissions?.[0])
|
||||
.reduce((sum?: number, cur?: number) => sum! | cur!, member.server?.default_permissions[0]) ?? 0;
|
||||
|
||||
return !!(userPerm & p);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue