corrige perm bug

This commit is contained in:
arthur
2024-07-08 22:39:14 +02:00
parent 287122e285
commit 4f1ab3e811
3 changed files with 18 additions and 11 deletions
+6 -1
View File
@@ -14,6 +14,11 @@ module.exports = async function getPermissionLevel(serverId, user) {
);
});
const highestPermission = Math.max(...perms.map((perm) => perm.permission));
let highestPermission;
if (perms.length === 0) {
highestPermission = 0
} else {
highestPermission = Math.max(...perms.map((perm) => perm.permission));
}
return highestPermission;
};