mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Make all VoiceChannel bitrates in bps (#2165)
* Make all VoiceChannel bitrates in bps instead of mixed kbps/bps * fix edit method in GuildChannel too
This commit is contained in:
@@ -25,7 +25,7 @@ class VoiceChannel extends GuildChannel {
|
||||
* The bitrate of this voice channel
|
||||
* @type {number}
|
||||
*/
|
||||
this.bitrate = data.bitrate * 0.001;
|
||||
this.bitrate = data.bitrate;
|
||||
|
||||
/**
|
||||
* The maximum amount of users allowed in this channel - 0 means unlimited.
|
||||
@@ -76,18 +76,17 @@ class VoiceChannel extends GuildChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the bitrate of the channel (in kbps).
|
||||
* Sets the bitrate of the channel.
|
||||
* @param {number} bitrate The new bitrate
|
||||
* @param {string} [reason] Reason for changing the channel's bitrate
|
||||
* @returns {Promise<VoiceChannel>}
|
||||
* @example
|
||||
* // Set the bitrate of a voice channel
|
||||
* voiceChannel.setBitrate(48)
|
||||
* .then(vc => console.log(`Set bitrate to ${vc.bitrate}kbps for ${vc.name}`))
|
||||
* voiceChannel.setBitrate(48000)
|
||||
* .then(vc => console.log(`Set bitrate to ${vc.bitrate}bps for ${vc.name}`))
|
||||
* .catch(console.error);
|
||||
*/
|
||||
setBitrate(bitrate, reason) {
|
||||
bitrate *= 1000;
|
||||
return this.edit({ bitrate }, reason);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user