Fix voice channel joining

This commit is contained in:
abalabahaha
2016-09-19 03:41:08 +09:00
parent 53ecaab12a
commit 3bc6ea455d
5 changed files with 11 additions and 11 deletions

View File

@@ -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");