mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 20:20:55 +00:00
Webpack build: 6adc8a9d0d
This commit is contained in:
parent
0c05926923
commit
f2156cfffd
2 changed files with 13 additions and 13 deletions
|
|
@ -1387,6 +1387,18 @@ class Role {
|
||||||
return this.guild.members.filter(m => m.roles.has(this.id));
|
return this.guild.members.filter(m => m.roles.has(this.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the role is editable by the client user.
|
||||||
|
* @type {boolean}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get editable() {
|
||||||
|
if (this.managed) return false;
|
||||||
|
const clientMember = this.guild.member(this.client.user);
|
||||||
|
if (!clientMember.hasPermission(Constants.PermissionFlags.MANAGE_ROLES_OR_PERMISSIONS)) return false;
|
||||||
|
return clientMember.highestRole.comparePositionTo(this) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an object mapping permission names to whether or not the role enables that permission
|
* Get an object mapping permission names to whether or not the role enables that permission
|
||||||
* @returns {Object<string, boolean>}
|
* @returns {Object<string, boolean>}
|
||||||
|
|
@ -1563,18 +1575,6 @@ class Role {
|
||||||
return this.client.rest.methods.deleteGuildRole(this);
|
return this.client.rest.methods.deleteGuildRole(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether the role is managable by the client user.
|
|
||||||
* @type {boolean}
|
|
||||||
* @readonly
|
|
||||||
*/
|
|
||||||
get editable() {
|
|
||||||
if (this.managed) return false;
|
|
||||||
const clientMember = this.guild.member(this.client.user);
|
|
||||||
if (!clientMember.hasPermission(Constants.PermissionFlags.MANAGE_ROLES_OR_PERMISSIONS)) return false;
|
|
||||||
return clientMember.highestRole.comparePositionTo(this) > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this role equals another role. It compares all properties, so for most operations
|
* Whether this role equals another role. It compares all properties, so for most operations
|
||||||
* it is advisable to just compare `role.id === role2.id` as it is much faster and is often
|
* it is advisable to just compare `role.id === role2.id` as it is much faster and is often
|
||||||
|
|
|
||||||
2
discord.indev.min.js
vendored
2
discord.indev.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue