mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
everything borked
This commit is contained in:
parent
d224c961d8
commit
ef48350e4e
|
@ -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