mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(Role): calculate position correctly when rawPositions are equal (#9872)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user