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

fix: Support reason in setRTCRegion helpers (v13) #7783

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
13 changes: 7 additions & 6 deletions src/structures/BaseGuildVoiceChannel.js
Expand Up @@ -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<BaseGuildVoiceChannel>}
* @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);
}

/**
Expand Down
9 changes: 5 additions & 4 deletions src/structures/StageChannel.js
Expand Up @@ -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<StageChannel>}
* @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.');
*/
}

Expand Down
9 changes: 5 additions & 4 deletions src/structures/VoiceChannel.js
Expand Up @@ -90,14 +90,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<VoiceChannel>}
* @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.');
*/
}

Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -449,7 +449,7 @@ export class BaseGuildVoiceChannel extends GuildChannel {
public bitrate: number;
public userLimit: number;
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
public setRTCRegion(region: string | null): Promise<this>;
public setRTCRegion(rtcRegion: string | null, reason?: string): Promise<this>;
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
}

Expand Down