mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
feat(StageInstanceManager): add guildScheduledEvent to create() (#8885)
* feat(StageInstanceManager): add `guildScheduledEvent` to `create()` * fix: requested changes --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -32,6 +32,8 @@ class StageInstanceManager extends CachedManager {
|
|||||||
* @property {string} topic The topic of the stage instance
|
* @property {string} topic The topic of the stage instance
|
||||||
* @property {StageInstancePrivacyLevel} [privacyLevel] The privacy level of the stage instance
|
* @property {StageInstancePrivacyLevel} [privacyLevel] The privacy level of the stage instance
|
||||||
* @property {boolean} [sendStartNotification] Whether to notify `@everyone` that the stage instance has started
|
* @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,7 +61,9 @@ class StageInstanceManager extends CachedManager {
|
|||||||
const channelId = this.guild.channels.resolveId(channel);
|
const channelId = this.guild.channels.resolveId(channel);
|
||||||
if (!channelId) throw new DiscordjsError(ErrorCodes.StageChannelResolve);
|
if (!channelId) throw new DiscordjsError(ErrorCodes.StageChannelResolve);
|
||||||
if (typeof options !== 'object') throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'options', 'object', true);
|
if (typeof options !== 'object') throw new DiscordjsTypeError(ErrorCodes.InvalidType, 'options', 'object', true);
|
||||||
let { topic, privacyLevel, sendStartNotification } = options;
|
const { guildScheduledEvent, topic, privacyLevel, sendStartNotification } = options;
|
||||||
|
|
||||||
|
const guildScheduledEventId = guildScheduledEvent && this.resolveId(guildScheduledEvent);
|
||||||
|
|
||||||
const data = await this.client.rest.post(Routes.stageInstances(), {
|
const data = await this.client.rest.post(Routes.stageInstances(), {
|
||||||
body: {
|
body: {
|
||||||
@@ -67,6 +71,7 @@ class StageInstanceManager extends CachedManager {
|
|||||||
topic,
|
topic,
|
||||||
privacy_level: privacyLevel,
|
privacy_level: privacyLevel,
|
||||||
send_start_notification: sendStartNotification,
|
send_start_notification: sendStartNotification,
|
||||||
|
guild_scheduled_event_id: guildScheduledEventId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -5214,6 +5214,7 @@ export interface StageInstanceCreateOptions {
|
|||||||
topic: string;
|
topic: string;
|
||||||
privacyLevel?: StageInstancePrivacyLevel;
|
privacyLevel?: StageInstancePrivacyLevel;
|
||||||
sendStartNotification?: boolean;
|
sendStartNotification?: boolean;
|
||||||
|
guildScheduledEvent?: GuildScheduledEventResolvable;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CrosspostedChannel {
|
export interface CrosspostedChannel {
|
||||||
|
|||||||
Reference in New Issue
Block a user