mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 19:24:43 +12:00
feat(StageInstanceManager): add guildScheduledEvent
to create()
(#9024)
* Update StageInstanceManager.js * typings * docs --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
parent
759c0b0d46
commit
5f6a82d349
2 changed files with 6 additions and 1 deletions
|
@ -32,6 +32,8 @@ class StageInstanceManager extends CachedManager {
|
|||
* @property {string} topic The topic of the stage instance
|
||||
* @property {PrivacyLevel|number} [privacyLevel] The privacy level of the stage instance
|
||||
* @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started
|
||||
* @property {GuildScheduledEventResolvable} [guildScheduledEvent]
|
||||
* The guild scheduled event associated with the stage instance
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -59,9 +61,10 @@ class StageInstanceManager extends CachedManager {
|
|||
const channelId = this.guild.channels.resolveId(channel);
|
||||
if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE');
|
||||
if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
|
||||
let { topic, privacyLevel, sendStartNotification } = options;
|
||||
let { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = options;
|
||||
|
||||
privacyLevel &&= typeof privacyLevel === 'number' ? privacyLevel : PrivacyLevels[privacyLevel];
|
||||
const guildScheduledEventId = guildScheduledEvent && this.resolveId(guildScheduledEvent);
|
||||
|
||||
const data = await this.client.api['stage-instances'].post({
|
||||
data: {
|
||||
|
@ -69,6 +72,7 @@ class StageInstanceManager extends CachedManager {
|
|||
topic,
|
||||
privacy_level: privacyLevel,
|
||||
send_start_notification: sendStartNotification,
|
||||
guild_scheduled_event_id: guildScheduledEventId,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
1
typings/index.d.ts
vendored
1
typings/index.d.ts
vendored
|
@ -4966,6 +4966,7 @@ export interface StageInstanceCreateOptions {
|
|||
topic: string;
|
||||
privacyLevel?: PrivacyLevel | number;
|
||||
sendStartNotification?: boolean;
|
||||
guildScheduledEvent?: GuildScheduledEventResolvable;
|
||||
}
|
||||
|
||||
export interface CrosspostedChannel {
|
||||
|
|
Loading…
Reference in a new issue