mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
feat(StageInstanceManager): add sendStartNotification option to create (#7730)
* feat(StageInstanceManager): add `sendStartNotification` option to create * docs: update property description Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,7 @@ class StageInstanceManager extends CachedManager {
|
|||||||
* @typedef {Object} StageInstanceCreateOptions
|
* @typedef {Object} StageInstanceCreateOptions
|
||||||
* @property {string} topic The topic of the stage instance
|
* @property {string} topic The topic of the stage instance
|
||||||
* @property {PrivacyLevel|number} [privacyLevel] The privacy level 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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,13 +59,14 @@ class StageInstanceManager extends CachedManager {
|
|||||||
const channelId = this.guild.channels.resolveId(channel);
|
const channelId = this.guild.channels.resolveId(channel);
|
||||||
if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE');
|
if (!channelId) throw new Error('STAGE_CHANNEL_RESOLVE');
|
||||||
if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
|
if (typeof options !== 'object') throw new TypeError('INVALID_TYPE', 'options', 'object', true);
|
||||||
let { topic, privacyLevel } = options;
|
let { topic, privacyLevel, sendStartNotification } = options;
|
||||||
|
|
||||||
const data = await this.client.rest.post(Routes.stageInstances(), {
|
const data = await this.client.rest.post(Routes.stageInstances(), {
|
||||||
body: {
|
body: {
|
||||||
channel_id: channelId,
|
channel_id: channelId,
|
||||||
topic,
|
topic,
|
||||||
privacy_level: privacyLevel,
|
privacy_level: privacyLevel,
|
||||||
|
send_start_notification: sendStartNotification,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -4015,6 +4015,7 @@ export interface CreateRoleOptions extends RoleData {
|
|||||||
export interface StageInstanceCreateOptions {
|
export interface StageInstanceCreateOptions {
|
||||||
topic: string;
|
topic: string;
|
||||||
privacyLevel?: StageInstancePrivacyLevel;
|
privacyLevel?: StageInstancePrivacyLevel;
|
||||||
|
sendStartNotification?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CrosspostedChannel {
|
export interface CrosspostedChannel {
|
||||||
|
|||||||
Reference in New Issue
Block a user