mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Add GuildMember.hasPermissions
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -191,6 +191,16 @@ class GuildMember {
|
|||||||
return this.roles.some(r => r.hasPermission(permission, explicit));
|
return this.roles.some(r => r.hasPermission(permission, explicit));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the roles of the members allow them to perform specific actions.
|
||||||
|
* @param {Array<PermissionResolvable>} permissions the permissions to test for
|
||||||
|
* @param {boolean} [explicit=false] whether to require the member to explicitly have the exact permissions
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
hasPermissions(permissions, explicit = false) {
|
||||||
|
return permissions.map(p => this.hasPermission(p, explicit)).every(v => v);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mute/unmute a user
|
* Mute/unmute a user
|
||||||
* @param {boolean} mute Whether or not the member should be muted
|
* @param {boolean} mute Whether or not the member should be muted
|
||||||
|
|||||||
Reference in New Issue
Block a user