mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
Improved Guild#createChannel, added RoleResolvable and fixed a bit of Emoji stuff (#1754)
* Made creating channels with overwrites nicer and added ClientDataResolver#resolveRole * Renamed ChannelPermissionOverwrites to ChannelCreationOverwrites * Added RoleResolvables everywhere possible * Fixed Emoji#setName resetting restricted roles and Emoji#equals Which will lead to emojis not to update when roles are being added removed.
This commit is contained in:
@@ -169,11 +169,13 @@ class Role {
|
||||
|
||||
/**
|
||||
* Compares this role's position to another role's.
|
||||
* @param {Role} role Role to compare to this one
|
||||
* @param {RoleResolvable} role Role to compare to this one
|
||||
* @returns {number} Negative number if the this role's position is lower (other role's is higher),
|
||||
* positive number if the this one is higher (other's is lower), 0 if equal
|
||||
*/
|
||||
comparePositionTo(role) {
|
||||
role = this.client.resolver.resolveRole(this.guild, role);
|
||||
if (!role) return Promise.reject(new TypeError('INVALID_TYPE', 'role', 'Role nor a Snowflake'));
|
||||
return this.constructor.comparePositions(this, role);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user