Skip to content

Commit 931c3ed

Browse files
almeidxJiralite
andauthored
feat(StageInstanceManager): add guildScheduledEvent to create() (#8885)
* feat(StageInstanceManager): add `guildScheduledEvent` to `create()` * fix: requested changes --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
1 parent eaabcdf commit 931c3ed

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/discord.js/src/managers/StageInstanceManager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ class StageInstanceManager extends CachedManager {
3232
* @property {string} topic The topic of the stage instance
3333
* @property {StageInstancePrivacyLevel} [privacyLevel] The privacy level of the stage instance
3434
* @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started
35+
* @property {GuildScheduledEventResolvable} [guildScheduledEvent]
36+
* The guild scheduled event associated with the stage instance
3537
*/
3638

3739
/**
@@ -59,14 +61,17 @@ class StageInstanceManager extends CachedManager {
5961
const channelId = this.guild.channels.resolveId(channel);
6062
if (!channelId) throw new DiscordjsError(ErrorCodes.StageChannelResolve);
6163
if (typeof options !== 'object') throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'options', 'object', true);
62-
let { topic, privacyLevel, sendStartNotification } = options;
64+
const { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = options;
65+
66+
const guildScheduledEventId = guildScheduledEvent && this.resolveId(guildScheduledEvent);
6367

6468
const data = await this.client.rest.post(Routes.stageInstances(), {
6569
body: {
6670
channel_id: channelId,
6771
topic,
6872
privacy_level: privacyLevel,
6973
send_start_notification: sendStartNotification,
74+
guild_scheduled_event_id: guildScheduledEventId,
7075
},
7176
});
7277

packages/discord.js/typings/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5214,6 +5214,7 @@ export interface StageInstanceCreateOptions {
52145214
topic: string;
52155215
privacyLevel?: StageInstancePrivacyLevel;
52165216
sendStartNotification?: boolean;
5217+
guildScheduledEvent?: GuildScheduledEventResolvable;
52175218
}
52185219

52195220
export interface CrosspostedChannel {

0 commit comments

Comments
 (0)