Skip to content

Commit cedc333

Browse files
authoredApr 14, 2022
feat: backport (#7783)
1 parent 6daee1b commit cedc333

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed
 

‎src/structures/BaseGuildVoiceChannel.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,18 @@ class BaseGuildVoiceChannel extends GuildChannel {
8282

8383
/**
8484
* Sets the RTC region of the channel.
85-
* @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel
85+
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
86+
* @param {string} [reason] The reason for modifying this region.
8687
* @returns {Promise<BaseGuildVoiceChannel>}
8788
* @example
88-
* // Set the RTC region to europe
89-
* channel.setRTCRegion('europe');
89+
* // Set the RTC region to sydney
90+
* channel.setRTCRegion('sydney');
9091
* @example
9192
* // Remove a fixed region for this channel - let Discord decide automatically
92-
* channel.setRTCRegion(null);
93+
* channel.setRTCRegion(null, 'We want to let Discord decide.');
9394
*/
94-
setRTCRegion(region) {
95-
return this.edit({ rtcRegion: region });
95+
setRTCRegion(rtcRegion, reason) {
96+
return this.edit({ rtcRegion }, reason);
9697
}
9798

9899
/**

‎src/structures/StageChannel.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,15 @@ class StageChannel extends BaseGuildVoiceChannel {
5555
/**
5656
* Sets the RTC region of the channel.
5757
* @name StageChannel#setRTCRegion
58-
* @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel
58+
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
59+
* @param {string} [reason] The reason for modifying this region.
5960
* @returns {Promise<StageChannel>}
6061
* @example
61-
* // Set the RTC region to europe
62-
* stageChannel.setRTCRegion('europe');
62+
* // Set the RTC region to sydney
63+
* stageChannel.setRTCRegion('sydney');
6364
* @example
6465
* // Remove a fixed region for this channel - let Discord decide automatically
65-
* stageChannel.setRTCRegion(null);
66+
* stageChannel.setRTCRegion(null, 'We want to let Discord decide.');
6667
*/
6768
}
6869

‎src/structures/VoiceChannel.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ class VoiceChannel extends BaseGuildVoiceChannel {
115115
/**
116116
* Sets the RTC region of the channel.
117117
* @name VoiceChannel#setRTCRegion
118-
* @param {?string} region The new region of the channel. Set to `null` to remove a specific region for the channel
118+
* @param {?string} rtcRegion The new region of the channel. Set to `null` to remove a specific region for the channel
119+
* @param {string} [reason] The reason for modifying this region.
119120
* @returns {Promise<VoiceChannel>}
120121
* @example
121-
* // Set the RTC region to europe
122-
* voiceChannel.setRTCRegion('europe');
122+
* // Set the RTC region to sydney
123+
* voiceChannel.setRTCRegion('sydney');
123124
* @example
124125
* // Remove a fixed region for this channel - let Discord decide automatically
125-
* voiceChannel.setRTCRegion(null);
126+
* voiceChannel.setRTCRegion(null, 'We want to let Discord decide.');
126127
*/
127128
}
128129

‎typings/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export class BaseGuildVoiceChannel extends GuildChannel {
450450
public bitrate: number;
451451
public userLimit: number;
452452
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
453-
public setRTCRegion(region: string | null): Promise<this>;
453+
public setRTCRegion(rtcRegion: string | null, reason?: string): Promise<this>;
454454
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
455455
}
456456

0 commit comments

Comments
 (0)
Please sign in to comment.