mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
feat(StageInstance): add support for associated guild event (#7713)
This commit is contained in:
@@ -72,6 +72,16 @@ class StageInstance extends Base {
|
||||
} else {
|
||||
this.discoverableDisabled ??= null;
|
||||
}
|
||||
|
||||
if ('guild_scheduled_event_id' in data) {
|
||||
/**
|
||||
* The associated guild scheduled event id of this stage instance
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.guildScheduledEventId = data.guild_scheduled_event_id;
|
||||
} else {
|
||||
this.guildScheduledEventId ??= null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,6 +93,15 @@ class StageInstance extends Base {
|
||||
return this.client.channels.resolve(this.channelId);
|
||||
}
|
||||
|
||||
/**
|
||||
* The associated guild scheduled event of this stage instance
|
||||
* @type {?GuildScheduledEvent}
|
||||
* @readonly
|
||||
*/
|
||||
get guildScheduledEvent() {
|
||||
return this.guild?.scheduledEvents.resolve(this.guildScheduledEventId) ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the stage instance has been deleted
|
||||
* @type {boolean}
|
||||
|
||||
Reference in New Issue
Block a user