-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GuildMember): add
flags
(#9098)
* feat: guildMember flags * Apply suggestions from code review Co-authored-by: Almeida <almeidx@pm.me> * Update GuildMember.js --------- Co-authored-by: Almeida <almeidx@pm.me>
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
const BitField = require('./BitField'); | ||
|
||
/** | ||
* Data structure that makes it easy to interact with an {@link GuildMember#flags} bitfield. | ||
* @extends {BitField} | ||
*/ | ||
class GuildMemberFlags extends BitField {} | ||
|
||
/** | ||
* @name GuildMemberFlags | ||
* @kind constructor | ||
* @memberof GuildMemberFlags | ||
* @param {BitFieldResolvable} [bits=0] Bit(s) to read from | ||
*/ | ||
|
||
/** | ||
* Numeric guild member flags. All available properties: | ||
* * `DID_REJOIN` | ||
* * `COMPLETED_ONBOARDING` | ||
* * `BYPASSES_VERIFICATION` | ||
* * `STARTED_ONBOARDING` | ||
* @type {Object} | ||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags} | ||
*/ | ||
GuildMemberFlags.FLAGS = { | ||
DID_REJOIN: 1 << 0, | ||
COMPLETED_ONBOARDING: 1 << 1, | ||
BYPASSES_VERIFICATION: 1 << 2, | ||
STARTED_ONBOARDING: 1 << 3, | ||
}; | ||
|
||
/** | ||
* Data that can be resolved to give a guild member flag bitfield. This can be: | ||
* * A string (see {@link GuildMemberFlags.FLAGS}) | ||
* * A guild member flag | ||
* * An instance of GuildMemberFlags | ||
* * An Array of GuildMemberFlagsResolvable | ||
* @typedef {string|number|GuildMemberFlags|GuildMemberFlagsResolvable[]} GuildMemberFlagsResolvable | ||
*/ | ||
|
||
module.exports = GuildMemberFlags; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters