fix(Role): calculate position correctly when rawPositions are equal (#9872)

This commit is contained in:
Vlad Frangu 2023-10-09 10:22:55 +03:00 committed by GitHub
parent 5f6a82d349
commit 56b481b3e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,7 +231,7 @@ class Role extends Base {
let count = 0;
for (const role of this.guild.roles.cache.values()) {
if (this.rawPosition > role.rawPosition) count++;
else if (this.rawPosition === role.rawPosition && BigInt(this.id) > BigInt(role.id)) count++;
else if (this.rawPosition === role.rawPosition && BigInt(this.id) < BigInt(role.id)) count++;
}
return count;