fix: temporary invite & feat: InviteFlags

This commit is contained in:
Elysia
2024-01-30 12:26:40 +07:00
parent 289f812ec6
commit 6307a4b7f2
6 changed files with 64 additions and 6 deletions
+11
View File
@@ -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();
}
}
/**