From 29f88079559cc02ccfef7a7c16458d481e573fb5 Mon Sep 17 00:00:00 2001 From: Almeida Date: Tue, 12 Apr 2022 16:17:49 +0100 Subject: [PATCH] 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> --- packages/discord.js/src/managers/StageInstanceManager.js | 4 +++- packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/discord.js/src/managers/StageInstanceManager.js b/packages/discord.js/src/managers/StageInstanceManager.js index cde863e40..4d3747b65 100644 --- a/packages/discord.js/src/managers/StageInstanceManager.js +++ b/packages/discord.js/src/managers/StageInstanceManager.js @@ -31,6 +31,7 @@ class StageInstanceManager extends CachedManager { * @typedef {Object} StageInstanceCreateOptions * @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 */ /** @@ -58,13 +59,14 @@ 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 } = options; + let { topic, privacyLevel, sendStartNotification } = options; const data = await this.client.rest.post(Routes.stageInstances(), { body: { channel_id: channelId, topic, privacy_level: privacyLevel, + send_start_notification: sendStartNotification, }, }); diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index ff60008e3..63d0bc708 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -4015,6 +4015,7 @@ export interface CreateRoleOptions extends RoleData { export interface StageInstanceCreateOptions { topic: string; privacyLevel?: StageInstancePrivacyLevel; + sendStartNotification?: boolean; } export interface CrosspostedChannel {