mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Fix voice channel joining
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user