mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Fix docs generator and add EvaluatedPermissions.hasPermissions()
This commit is contained in:
@@ -42,6 +42,16 @@ class EvaluatedPermissions {
|
||||
if (!explicit && (this.raw & Constants.PermissionFlags.ADMINISTRATOR) > 0) return true;
|
||||
return (this.raw & permission) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a user has multiple permissions in a channel.
|
||||
* @param {Array<PermissionResolvable>} permissions the permissions to test for
|
||||
* @param {boolean} [explicit=false] whether to require the user to explicitly have the exact permissions
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasPermissions(permissions, explicit = false) {
|
||||
return permissions.map(p => this.hasPermission(p, explicit)).every(v => v);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EvaluatedPermissions;
|
||||
|
||||
@@ -29,7 +29,7 @@ class TextChannel extends GuildChannel {
|
||||
|
||||
/**
|
||||
* A collection of members that can see this channel, mapped by their ID.
|
||||
* @returns {Collection<string, GuildMember>}
|
||||
* @type {Collection<string, GuildMember>}
|
||||
* @readonly
|
||||
*/
|
||||
get members() {
|
||||
|
||||
Reference in New Issue
Block a user