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

docs: Correctly overwrite setRTCRegion method #8642

Merged
merged 3 commits into from Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
30 changes: 16 additions & 14 deletions packages/discord.js/src/structures/StageChannel.js
Expand Up @@ -51,20 +51,22 @@ class StageChannel extends BaseGuildVoiceChannel {
setTopic(topic, reason) {
return this.edit({ topic, reason });
}

/**
* Sets the RTC region of the channel.
* @name StageChannel#setRTCRegion
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
* @param {string} [reason] The reason for modifying this region.
* @returns {Promise<StageChannel>}
* @example
* // Set the RTC region to sydney
* stageChannel.setRTCRegion('sydney');
* @example
* // Remove a fixed region for this channel - let Discord decide automatically
* stageChannel.setRTCRegion(null, 'We want to let Discord decide.');
*/
}

/**
* Sets the RTC region of the channel.
* @method setRTCRegion
* @memberof StageChannel
* @instance
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
* @param {string} [reason] The reason for modifying this region.
* @returns {Promise<StageChannel>}
* @example
* // Set the RTC region to sydney
* stageChannel.setRTCRegion('sydney');
* @example
* // Remove a fixed region for this channel - let Discord decide automatically
* stageChannel.setRTCRegion(null, 'We want to let Discord decide.');
*/

module.exports = StageChannel;
30 changes: 16 additions & 14 deletions packages/discord.js/src/structures/VoiceChannel.js
Expand Up @@ -149,22 +149,24 @@ class VoiceChannel extends BaseGuildVoiceChannel {
createWebhook() {}
setRateLimitPerUser() {}
setNSFW() {}

/**
* Sets the RTC region of the channel.
* @name VoiceChannel#setRTCRegion
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
* @param {string} [reason] The reason for modifying this region.
* @returns {Promise<VoiceChannel>}
* @example
* // Set the RTC region to sydney
* voiceChannel.setRTCRegion('sydney');
* @example
* // Remove a fixed region for this channel - let Discord decide automatically
* voiceChannel.setRTCRegion(null, 'We want to let Discord decide.');
*/
}

TextBasedChannel.applyToClass(VoiceChannel, true, ['lastPinAt']);

/**
* Sets the RTC region of the channel.
* @method setRTCRegion
* @memberof VoiceChannel
* @instance
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
* @param {string} [reason] The reason for modifying this region.
* @returns {Promise<VoiceChannel>}
* @example
* // Set the RTC region to sydney
* voiceChannel.setRTCRegion('sydney');
* @example
* // Remove a fixed region for this channel - let Discord decide automatically
* voiceChannel.setRTCRegion(null, 'We want to let Discord decide.');
*/

module.exports = VoiceChannel;