From f0497343f1193635b260b9e2085cac7b43991f74 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Mon, 19 Sep 2022 22:07:58 +0100 Subject: [PATCH] docs: Correctly overwrite `setRTCRegion` method (#8642) docs: correctly overwrite `setRTCRegion` method Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../discord.js/src/structures/StageChannel.js | 30 ++++++++++--------- .../discord.js/src/structures/VoiceChannel.js | 30 ++++++++++--------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/packages/discord.js/src/structures/StageChannel.js b/packages/discord.js/src/structures/StageChannel.js index 14070c475de2..0f399c3b1659 100644 --- a/packages/discord.js/src/structures/StageChannel.js +++ b/packages/discord.js/src/structures/StageChannel.js @@ -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} - * @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} + * @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; diff --git a/packages/discord.js/src/structures/VoiceChannel.js b/packages/discord.js/src/structures/VoiceChannel.js index e85cef2f1397..1bfc5dae66d7 100644 --- a/packages/discord.js/src/structures/VoiceChannel.js +++ b/packages/discord.js/src/structures/VoiceChannel.js @@ -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} - * @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} + * @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;