mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
feat(Permissions): add new method Permissions#any (#3450)
* Add new method Permissions#any * Update src/util/BitField.js This is much better Co-Authored-By: bdistin <bdistin@gmail.com> * Remove unreachable code * Gotta keep the linter happy * Apply bdistin suggested change to both methods
This commit is contained in:
@@ -17,6 +17,15 @@ class BitField {
|
||||
this.bitfield = this.constructor.resolve(bits);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the bitfield has a bit, or any of multiple bits.
|
||||
* @param {BitFieldResolvable} bit Bit(s) to check for
|
||||
* @returns {boolean}
|
||||
*/
|
||||
any(bit) {
|
||||
return (this.bitfield & this.constructor.resolve(bit)) !== 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this bitfield equals another
|
||||
* @param {BitFieldResolvable} bit Bit(s) to check for
|
||||
|
||||
Reference in New Issue
Block a user