mirror of
https://github.com/danbulant/discord.js
synced 2026-07-03 10:10:49 +00:00
Webpack build for branch master: f89ec00b30
This commit is contained in:
parent
cbb058a322
commit
fc80d43a70
2 changed files with 1 additions and 34 deletions
|
|
@ -8015,39 +8015,6 @@ class Role extends Base {
|
||||||
return sorted.array().indexOf(sorted.get(this.id));
|
return sorted.array().indexOf(sorted.get(this.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get an object mapping permission names to whether or not the role enables that permission.
|
|
||||||
* @returns {Object<string, boolean>}
|
|
||||||
* @example
|
|
||||||
* // Print the serialized role permissions
|
|
||||||
* console.log(role.serialize());
|
|
||||||
*/
|
|
||||||
serialize() {
|
|
||||||
return this.permissions.serialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the role has a permission.
|
|
||||||
* @param {PermissionResolvable|PermissionResolvable[]} permission Permission(s) to check for
|
|
||||||
* @param {boolean} [explicit=false] Whether to require the role to explicitly have the exact permission
|
|
||||||
* **(deprecated)**
|
|
||||||
* @param {boolean} [checkAdmin] Whether to allow the administrator permission to override
|
|
||||||
* (takes priority over `explicit`)
|
|
||||||
* @returns {boolean}
|
|
||||||
* @example
|
|
||||||
* // See if a role can ban a member
|
|
||||||
* if (role.hasPermission('BAN_MEMBERS')) {
|
|
||||||
* console.log('This role can ban members');
|
|
||||||
* } else {
|
|
||||||
* console.log('This role can\'t ban members');
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
hasPermission(permission, explicit = false, checkAdmin) {
|
|
||||||
return this.permissions.has(
|
|
||||||
permission, typeof checkAdmin !== 'undefined' ? checkAdmin : !explicit
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this role's position to another role's.
|
* Compares this role's position to another role's.
|
||||||
* @param {RoleResolvable} role Role to compare to this one
|
* @param {RoleResolvable} role Role to compare to this one
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue