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

#9872 djs
This commit is contained in:
Elysia 2023-10-29 13:17:35 +07:00
parent 58f7e5299b
commit a25d839f99

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;