From cedc3339401349dfa00990be204b203ef46a3545 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Thu, 14 Apr 2022 11:44:24 +0100 Subject: [PATCH] feat: backport (#7783) --- src/structures/BaseGuildVoiceChannel.js | 13 +++++++------ src/structures/StageChannel.js | 9 +++++---- src/structures/VoiceChannel.js | 9 +++++---- typings/index.d.ts | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/structures/BaseGuildVoiceChannel.js b/src/structures/BaseGuildVoiceChannel.js index e048eb3e6c34..8fe65a16715f 100644 --- a/src/structures/BaseGuildVoiceChannel.js +++ b/src/structures/BaseGuildVoiceChannel.js @@ -82,17 +82,18 @@ class BaseGuildVoiceChannel extends GuildChannel { /** * Sets the RTC region of the channel. - * @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel + * @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 europe - * channel.setRTCRegion('europe'); + * // Set the RTC region to sydney + * channel.setRTCRegion('sydney'); * @example * // Remove a fixed region for this channel - let Discord decide automatically - * channel.setRTCRegion(null); + * channel.setRTCRegion(null, 'We want to let Discord decide.'); */ - setRTCRegion(region) { - return this.edit({ rtcRegion: region }); + setRTCRegion(rtcRegion, reason) { + return this.edit({ rtcRegion }, reason); } /** diff --git a/src/structures/StageChannel.js b/src/structures/StageChannel.js index f5fb4d88da17..b57beb5cb228 100644 --- a/src/structures/StageChannel.js +++ b/src/structures/StageChannel.js @@ -55,14 +55,15 @@ class StageChannel extends BaseGuildVoiceChannel { /** * Sets the RTC region of the channel. * @name StageChannel#setRTCRegion - * @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel + * @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 europe - * stageChannel.setRTCRegion('europe'); + * // Set the RTC region to sydney + * stageChannel.setRTCRegion('sydney'); * @example * // Remove a fixed region for this channel - let Discord decide automatically - * stageChannel.setRTCRegion(null); + * stageChannel.setRTCRegion(null, 'We want to let Discord decide.'); */ } diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js index 2888ce24b67c..3ad79269ca00 100644 --- a/src/structures/VoiceChannel.js +++ b/src/structures/VoiceChannel.js @@ -115,14 +115,15 @@ class VoiceChannel extends BaseGuildVoiceChannel { /** * Sets the RTC region of the channel. * @name VoiceChannel#setRTCRegion - * @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel + * @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 europe - * voiceChannel.setRTCRegion('europe'); + * // Set the RTC region to sydney + * voiceChannel.setRTCRegion('sydney'); * @example * // Remove a fixed region for this channel - let Discord decide automatically - * voiceChannel.setRTCRegion(null); + * voiceChannel.setRTCRegion(null, 'We want to let Discord decide.'); */ } diff --git a/typings/index.d.ts b/typings/index.d.ts index 9755f26b2e92..17e2d4c4c004 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -450,7 +450,7 @@ export class BaseGuildVoiceChannel extends GuildChannel { public bitrate: number; public userLimit: number; public createInvite(options?: CreateInviteOptions): Promise; - public setRTCRegion(region: string | null): Promise; + public setRTCRegion(rtcRegion: string | null, reason?: string): Promise; public fetchInvites(cache?: boolean): Promise>; }