feat: backport (#7779)

This commit is contained in:
Jiralite
2022-04-14 11:45:16 +01:00
committed by GitHub
parent cedc333940
commit ae7f991e8d
2 changed files with 4 additions and 1 deletions

View File

@@ -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,7 +59,7 @@ 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;
privacyLevel &&= typeof privacyLevel === 'number' ? privacyLevel : PrivacyLevels[privacyLevel];
@@ -67,6 +68,7 @@ class StageInstanceManager extends CachedManager {
channel_id: channelId,
topic,
privacy_level: privacyLevel,
send_start_notification: sendStartNotification,
},
});

1
typings/index.d.ts vendored
View File

@@ -4466,6 +4466,7 @@ export interface CreateRoleOptions extends RoleData {
export interface StageInstanceCreateOptions {
topic: string;
privacyLevel?: PrivacyLevel | number;
sendStartNotification?: boolean;
}
export interface CrosspostedChannel {