Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(StageInstanceManager): add sendStartNotification option to create (v13) #7779

Merged
merged 1 commit into from Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/managers/StageInstanceManager.js
Expand Up @@ -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
*/

/**
Expand Down Expand Up @@ -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];

Expand All @@ -67,6 +68,7 @@ class StageInstanceManager extends CachedManager {
channel_id: channelId,
topic,
privacy_level: privacyLevel,
send_start_notification: sendStartNotification,
},
});

Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -4461,6 +4461,7 @@ export interface CreateRoleOptions extends RoleData {
export interface StageInstanceCreateOptions {
topic: string;
privacyLevel?: PrivacyLevel | number;
sendStartNotification?: boolean;
}

export interface CrosspostedChannel {
Expand Down