mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 17:21:31 +00:00
fix: re-add highest property to RoleStore and GuildMemberRoleStore
closes #2302
This commit is contained in:
parent
2a9fdef9e5
commit
9b41a6a8a6
2 changed files with 10 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ class GuildMemberRoleStore extends DataStore {
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get highest() {
|
get highest() {
|
||||||
return this.reduce((prev, role) => !prev || role.comparePositionTo(prev) > 0 ? role : prev);
|
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,15 @@ class RoleStore extends DataStore {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The role with the highest position in the store
|
||||||
|
* @type {Role}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get highest() {
|
||||||
|
return this.reduce((prev, role) => role.comparePositionTo(prev) > 0 ? role : prev, this.first());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data that can be resolved to a Role object. This can be:
|
* Data that can be resolved to a Role object. This can be:
|
||||||
* * A Role
|
* * A Role
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue