slight fix for deleted roles without members inten

This commit is contained in:
Skillz
2020-10-26 11:40:35 -04:00
parent 7635c98af1
commit 1c65db528f
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -58,6 +58,8 @@ export async function botHasPermission(
const permissionBits = member.roles
.map((id) => guild.roles.get(id)!)
// Remove any edge case undefined
.filter((r) => r)
.reduce((bits, data) => {
bits |= BigInt(data.permissions);