mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +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 {
|
} 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.channels.resolve(this.channelId);
|
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
|
* Whether or not the stage instance has been deleted
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -2246,8 +2246,10 @@ export class StageInstance extends Base {
|
|||||||
public topic: string;
|
public topic: string;
|
||||||
public privacyLevel: PrivacyLevel;
|
public privacyLevel: PrivacyLevel;
|
||||||
public discoverableDisabled: boolean | null;
|
public discoverableDisabled: boolean | null;
|
||||||
|
public guildScheduledEventId?: Snowflake;
|
||||||
public readonly channel: StageChannel | null;
|
public readonly channel: StageChannel | null;
|
||||||
public readonly guild: Guild | null;
|
public readonly 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