diff --git a/src/managers/StageInstanceManager.js b/src/managers/StageInstanceManager.js index cea3670..6a59e4e 100644 --- a/src/managers/StageInstanceManager.js +++ b/src/managers/StageInstanceManager.js @@ -32,6 +32,8 @@ class StageInstanceManager extends CachedManager { * @property {string} topic The topic of the stage instance * @property {PrivacyLevel|number} [privacyLevel] The privacy level of the stage instance * @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started + * @property {GuildScheduledEventResolvable} [guildScheduledEvent] + * The guild scheduled event associated with the stage instance */ /** @@ -59,9 +61,10 @@ class StageInstanceManager extends CachedManager { const channelId = this.guild.channels.resolveId(channel); if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE'); if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true); - let { topic, privacyLevel, sendStartNotification } = options; + let { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = options; privacyLevel &&= typeof privacyLevel === 'number' ? privacyLevel : PrivacyLevels[privacyLevel]; + const guildScheduledEventId = guildScheduledEvent && this.resolveId(guildScheduledEvent); const data = await this.client.api['stage-instances'].post({ data: { @@ -69,6 +72,7 @@ class StageInstanceManager extends CachedManager { topic, privacy_level: privacyLevel, send_start_notification: sendStartNotification, + guild_scheduled_event_id: guildScheduledEventId, }, }); diff --git a/typings/index.d.ts b/typings/index.d.ts index a00f7de..88a0888 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -5646,6 +5646,7 @@ export interface StageInstanceCreateOptions { topic: string; privacyLevel?: PrivacyLevel | number; sendStartNotification?: boolean; + guildScheduledEvent?: GuildScheduledEventResolvable; } export interface CrosspostedChannel {