mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat: backport (#7783)
This commit is contained in:
@@ -82,17 +82,18 @@ class BaseGuildVoiceChannel extends GuildChannel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the RTC region of the channel.
|
* 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>}
|
* @returns {Promise<BaseGuildVoiceChannel>}
|
||||||
* @example
|
* @example
|
||||||
* // Set the RTC region to europe
|
* // Set the RTC region to sydney
|
||||||
* channel.setRTCRegion('europe');
|
* channel.setRTCRegion('sydney');
|
||||||
* @example
|
* @example
|
||||||
* // Remove a fixed region for this channel - let Discord decide automatically
|
* // 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) {
|
setRTCRegion(rtcRegion, reason) {
|
||||||
return this.edit({ rtcRegion: region });
|
return this.edit({ rtcRegion }, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -55,14 +55,15 @@ class StageChannel extends BaseGuildVoiceChannel {
|
|||||||
/**
|
/**
|
||||||
* Sets the RTC region of the channel.
|
* Sets the RTC region of the channel.
|
||||||
* @name StageChannel#setRTCRegion
|
* @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>}
|
* @returns {Promise<StageChannel>}
|
||||||
* @example
|
* @example
|
||||||
* // Set the RTC region to europe
|
* // Set the RTC region to sydney
|
||||||
* stageChannel.setRTCRegion('europe');
|
* stageChannel.setRTCRegion('sydney');
|
||||||
* @example
|
* @example
|
||||||
* // Remove a fixed region for this channel - let Discord decide automatically
|
* // Remove a fixed region for this channel - let Discord decide automatically
|
||||||
* stageChannel.setRTCRegion(null);
|
* stageChannel.setRTCRegion(null, 'We want to let Discord decide.');
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,14 +115,15 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|||||||
/**
|
/**
|
||||||
* Sets the RTC region of the channel.
|
* Sets the RTC region of the channel.
|
||||||
* @name VoiceChannel#setRTCRegion
|
* @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>}
|
* @returns {Promise<VoiceChannel>}
|
||||||
* @example
|
* @example
|
||||||
* // Set the RTC region to europe
|
* // Set the RTC region to sydney
|
||||||
* voiceChannel.setRTCRegion('europe');
|
* voiceChannel.setRTCRegion('sydney');
|
||||||
* @example
|
* @example
|
||||||
* // Remove a fixed region for this channel - let Discord decide automatically
|
* // Remove a fixed region for this channel - let Discord decide automatically
|
||||||
* voiceChannel.setRTCRegion(null);
|
* voiceChannel.setRTCRegion(null, 'We want to let Discord decide.');
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -450,7 +450,7 @@ export class BaseGuildVoiceChannel extends GuildChannel {
|
|||||||
public bitrate: number;
|
public bitrate: number;
|
||||||
public userLimit: number;
|
public userLimit: number;
|
||||||
public createInvite(options?: CreateInviteOptions): Promise<Invite>;
|
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>>;
|
public fetchInvites(cache?: boolean): Promise<Collection<string, Invite>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user