fix: temporary invite & feat: InviteFlags
This commit is contained in:
@@ -47,17 +47,21 @@ class ClientUser extends User {
|
||||
if ('purchased_flags' in data) {
|
||||
/**
|
||||
* Purchased state of the client user.
|
||||
* @type {?PurchasedFlags}
|
||||
* @type {Readonly<PurchasedFlags>}
|
||||
*/
|
||||
this.purchasedFlags = new PurchasedFlags(data.purchased_flags || 0);
|
||||
this.purchasedFlags = new PurchasedFlags(data.purchased_flags || 0).freeze();
|
||||
} else {
|
||||
this.purchasedFlags = new PurchasedFlags().freeze();
|
||||
}
|
||||
|
||||
if ('premium_usage_flags' in data) {
|
||||
/**
|
||||
* Premium usage state of the client user.
|
||||
* @type {?PremiumUsageFlags}
|
||||
* @type {Readonly<PremiumUsageFlags>}
|
||||
*/
|
||||
this.premiumUsageFlags = new PremiumUsageFlags(data.premium_usage_flags || 0);
|
||||
} else {
|
||||
this.premiumUsageFlags = new PremiumUsageFlags().freeze();
|
||||
}
|
||||
|
||||
if ('phone' in data) {
|
||||
|
@@ -6,6 +6,7 @@ const IntegrationApplication = require('./IntegrationApplication');
|
||||
const InviteStageInstance = require('./InviteStageInstance');
|
||||
const { Error } = require('../errors');
|
||||
const { Endpoints } = require('../util/Constants');
|
||||
const InviteFlags = require('../util/InviteFlags');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
// TODO: Convert `inviter` and `channel` in this class to a getter.
|
||||
@@ -242,6 +243,16 @@ class Invite extends Base {
|
||||
} else {
|
||||
this.guildScheduledEvent ??= null;
|
||||
}
|
||||
|
||||
if ('flags' in data) {
|
||||
/**
|
||||
* The flags that are applied to the invite.
|
||||
* @type {?Readonly<InviteFlags>}
|
||||
*/
|
||||
this.flags = new InviteFlags(data.flags).freeze();
|
||||
} else {
|
||||
this.flags ??= new InviteFlags().freeze();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user