From fe9ea02f8bc9d025012ee8c42fc51360f0b4e2ec Mon Sep 17 00:00:00 2001 From: bdistin Date: Mon, 11 Dec 2017 22:02:53 -0600 Subject: [PATCH] Make all VoiceChannel bitrates in bps (#2165) * Make all VoiceChannel bitrates in bps instead of mixed kbps/bps * fix edit method in GuildChannel too --- src/structures/GuildChannel.js | 2 +- src/structures/VoiceChannel.js | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index a84ad0847..fa0f8f844 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -292,7 +292,7 @@ class GuildChannel extends Channel { name: (data.name || this.name).trim(), topic: data.topic, nsfw: data.nsfw, - bitrate: data.bitrate || (this.bitrate ? this.bitrate * 1000 : undefined), + bitrate: data.bitrate || this.bitrate, user_limit: typeof data.userLimit !== 'undefined' ? data.userLimit : this.userLimit, parent_id: data.parentID, lock_permissions: data.lockPermissions, diff --git a/src/structures/VoiceChannel.js b/src/structures/VoiceChannel.js index 2fa37d233..05b840444 100644 --- a/src/structures/VoiceChannel.js +++ b/src/structures/VoiceChannel.js @@ -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} * @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); }