File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ exports.Constants = require('./util/Constants.js');
2929exports . Events = require ( './util/Events.js' ) . Events ;
3030exports . GuildMemberFlagsBitField = require ( './util/GuildMemberFlagsBitField.js' ) . GuildMemberFlagsBitField ;
3131exports . IntentsBitField = require ( './util/IntentsBitField.js' ) . IntentsBitField ;
32+ exports . InviteFlagsBitField = require ( './util/InviteFlagsBitField.js' ) . InviteFlagsBitField ;
3233exports . LimitedCollection = require ( './util/LimitedCollection.js' ) . LimitedCollection ;
3334exports . MessageFlagsBitField = require ( './util/MessageFlagsBitField.js' ) . MessageFlagsBitField ;
3435exports . Options = require ( './util/Options.js' ) . Options ;
Original file line number Diff line number Diff line change 22
33const { Routes, PermissionFlagsBits, InviteType } = require ( 'discord-api-types/v10' ) ;
44const { DiscordjsError, ErrorCodes } = require ( '../errors/index.js' ) ;
5+ const { InviteFlagsBitField } = require ( '../util/InviteFlagsBitField.js' ) ;
56const { BaseInvite } = require ( './BaseInvite.js' ) ;
67const { GuildScheduledEvent } = require ( './GuildScheduledEvent.js' ) ;
78const { IntegrationApplication } = require ( './IntegrationApplication.js' ) ;
@@ -48,6 +49,17 @@ class GuildInvite extends BaseInvite {
4849 _patch ( data ) {
4950 super . _patch ( data ) ;
5051
52+ if ( 'flags' in data ) {
53+ /**
54+ * The flags of this invite.
55+ *
56+ * @type {Readonly<InviteFlagsBitField> }
57+ */
58+ this . flags = new InviteFlagsBitField ( data . flags ) . freeze ( ) ;
59+ } else {
60+ this . flags ??= new InviteFlagsBitField ( ) . freeze ( ) ;
61+ }
62+
5163 if ( 'guild' in data ) {
5264 /**
5365 * The guild the invite is for. May include welcome screen data.
Original file line number Diff line number Diff line change 1+ /* eslint-disable jsdoc/check-values */
2+ 'use strict' ;
3+
4+ const { InviteFlags } = require ( 'discord-api-types/v10' ) ;
5+ const { BitField } = require ( './BitField.js' ) ;
6+
7+ /**
8+ * Data structure that makes it easy to interact with an {@link GuildInvite#flags} bit field.
9+ *
10+ * @extends {BitField }
11+ */
12+ class InviteFlagsBitField extends BitField {
13+ /**
14+ * Numeric invite flags.
15+ *
16+ * @type {InviteFlags }
17+ * @memberof InviteFlagsBitField
18+ */
19+ static Flags = InviteFlags ;
20+ }
21+
22+ /**
23+ * @name InviteFlagsBitField
24+ * @kind constructor
25+ * @memberof InviteFlagsBitField
26+ * @param {BitFieldResolvable } [bits=0] Bit(s) to read from
27+ */
28+
29+ exports . InviteFlagsBitField = InviteFlagsBitField ;
You can’t perform that action at this time.
0 commit comments