mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
feat(StageInstance): Add support for associated guild event (#7576)
This commit is contained in:
@@ -63,6 +63,16 @@ class StageInstance extends Base {
|
|||||||
} else {
|
} else {
|
||||||
this.discoverableDisabled ??= null;
|
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.guilds.resolve(this.guildId);
|
return this.client.guilds.resolve(this.guildId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The associated guild scheduled event of this stage instance
|
||||||
|
* @type {?GuildScheduledEvent}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get guildScheduledEvent() {
|
||||||
|
return this.guild?.scheduledEvents.resolve(this.guildScheduledEventId) ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits this stage instance.
|
* Edits this stage instance.
|
||||||
* @param {StageInstanceEditOptions} options The options to edit the stage instance
|
* @param {StageInstanceEditOptions} options The options to edit the stage instance
|
||||||
|
|||||||
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
@@ -2106,8 +2106,10 @@ export class StageInstance extends Base {
|
|||||||
public privacyLevel: StageInstancePrivacyLevel;
|
public privacyLevel: StageInstancePrivacyLevel;
|
||||||
/** @deprecated See https://github.com/discord/discord-api-docs/pull/4296 for more information */
|
/** @deprecated See https://github.com/discord/discord-api-docs/pull/4296 for more information */
|
||||||
public discoverableDisabled: boolean | null;
|
public discoverableDisabled: boolean | null;
|
||||||
|
public guildScheduledEventId?: Snowflake;
|
||||||
public get channel(): StageChannel | null;
|
public get channel(): StageChannel | null;
|
||||||
public get guild(): Guild | null;
|
public get guild(): Guild | null;
|
||||||
|
public get guildScheduledEvent(): GuildScheduledEvent | null;
|
||||||
public edit(options: StageInstanceEditOptions): Promise<StageInstance>;
|
public edit(options: StageInstanceEditOptions): Promise<StageInstance>;
|
||||||
public delete(): Promise<StageInstance>;
|
public delete(): Promise<StageInstance>;
|
||||||
public setTopic(topic: string): Promise<StageInstance>;
|
public setTopic(topic: string): Promise<StageInstance>;
|
||||||
|
|||||||
Reference in New Issue
Block a user