diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index caaadb579..a88148e9c 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -336,7 +336,7 @@ var InternalClient = (function () { return Promise.reject(new Error("voice channel does not exist")); } - if (channel.type !== 'voice') { + if (channel.type !== 2) { return Promise.reject(new Error("channel is not a voice channel!")); } @@ -394,7 +394,7 @@ var InternalClient = (function () { return Promise.reject(new Error("voice channel does not exist")); } - if (channel.type !== 'voice') { + if (channel.type !== 2) { return Promise.reject(new Error("channel is not a voice channel!")); } @@ -1157,7 +1157,7 @@ var InternalClient = (function () { var server = channel.server; // Make sure `channel` is a voice channel - if (channel.type !== "voice") { + if (channel.type !== 2) { throw new Error("Can't moveMember into a non-voice channel"); } else { return _this23.apiRequest("patch", _Constants.Endpoints.SERVER_MEMBERS(server.id) + "/" + user.id, true, { channel_id: channel.id }).then(function (res) { @@ -2525,7 +2525,7 @@ var InternalClient = (function () { if (data.channel_id) { // in voice channel var channel = this.channels.get("id", data.channel_id); - if (channel && channel.type === "voice") { + if (channel && channel.type === 2) { server.eventVoiceStateUpdate(channel, user, data); } else { client.emit("warn", "voice state channel not in cache"); diff --git a/lib/Structures/Server.js b/lib/Structures/Server.js index 0952a8f4a..5f66766b9 100644 --- a/lib/Structures/Server.js +++ b/lib/Structures/Server.js @@ -326,7 +326,7 @@ var Server = (function (_Equality) { }; Server.prototype.eventVoiceLeave = function eventVoiceLeave(user) { - for (var _iterator4 = this.channels.getAll("type", "voice"), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + for (var _iterator4 = this.channels.getAll("type", 2), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref4; if (_isArray4) { diff --git a/package.json b/package.json index f1584b2b8..8ce962bc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord.js", - "version": "8.1.0", + "version": "8.2.0", "description": "A way to interface with the Discord API", "main": "./entrypoint.js", "scripts": { diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 76ddbd3a7..8c762a760 100755 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -245,7 +245,7 @@ export default class InternalClient { return Promise.reject(new Error("voice channel does not exist")); } - if (channel.type !== 'voice') { + if (channel.type !== 2) { return Promise.reject(new Error("channel is not a voice channel!")); } @@ -297,7 +297,7 @@ export default class InternalClient { return Promise.reject(new Error("voice channel does not exist")); } - if (channel.type !== 'voice') { + if (channel.type !== 2) { return Promise.reject(new Error("channel is not a voice channel!")); } @@ -1007,7 +1007,7 @@ export default class InternalClient { var server = channel.server; // Make sure `channel` is a voice channel - if (channel.type !== "voice") { + if (channel.type !== 2) { throw new Error("Can't moveMember into a non-voice channel"); } else { return this.apiRequest("patch", `${Endpoints.SERVER_MEMBERS(server.id)}/${user.id}`, true, { channel_id: channel.id }) @@ -2262,7 +2262,7 @@ export default class InternalClient { if (data.channel_id) { // in voice channel var channel = this.channels.get("id", data.channel_id); - if (channel && channel.type === "voice") { + if (channel && channel.type === 2) { server.eventVoiceStateUpdate(channel, user, data); } else { client.emit("warn", "voice state channel not in cache"); diff --git a/src/Structures/Server.js b/src/Structures/Server.js index 70383792e..4c47a0bda 100644 --- a/src/Structures/Server.js +++ b/src/Structures/Server.js @@ -262,7 +262,7 @@ export default class Server extends Equality { } eventVoiceLeave(user) { - for (let chan of this.channels.getAll("type", "voice")) { + for (let chan of this.channels.getAll("type", 2)) { if (chan.members.has("id", user.id)) { chan.members.remove(user); user.voiceChannel = null;