Skip to content

Commit 68498a8

Browse files
authoredApr 12, 2022
feat(StageInstance): add support for associated guild event (#7713)
1 parent ab6c2ba commit 68498a8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
 

‎src/structures/StageInstance.js

+19
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ class StageInstance extends Base {
7272
} else {
7373
this.discoverableDisabled ??= null;
7474
}
75+
76+
if ('guild_scheduled_event_id' in data) {
77+
/**
78+
* The associated guild scheduled event id of this stage instance
79+
* @type {?Snowflake}
80+
*/
81+
this.guildScheduledEventId = data.guild_scheduled_event_id;
82+
} else {
83+
this.guildScheduledEventId ??= null;
84+
}
7585
}
7686

7787
/**
@@ -83,6 +93,15 @@ class StageInstance extends Base {
8393
return this.client.channels.resolve(this.channelId);
8494
}
8595

96+
/**
97+
* The associated guild scheduled event of this stage instance
98+
* @type {?GuildScheduledEvent}
99+
* @readonly
100+
*/
101+
get guildScheduledEvent() {
102+
return this.guild?.scheduledEvents.resolve(this.guildScheduledEventId) ?? null;
103+
}
104+
86105
/**
87106
* Whether or not the stage instance has been deleted
88107
* @type {boolean}

‎typings/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2246,8 +2246,10 @@ export class StageInstance extends Base {
22462246
public topic: string;
22472247
public privacyLevel: PrivacyLevel;
22482248
public discoverableDisabled: boolean | null;
2249+
public guildScheduledEventId?: Snowflake;
22492250
public readonly channel: StageChannel | null;
22502251
public readonly guild: Guild | null;
2252+
public get guildScheduledEvent(): GuildScheduledEvent | null;
22512253
public edit(options: StageInstanceEditOptions): Promise<StageInstance>;
22522254
public delete(): Promise<StageInstance>;
22532255
public setTopic(topic: string): Promise<StageInstance>;

0 commit comments

Comments
 (0)
Please sign in to comment.