mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
@@ -370,9 +370,7 @@ var InternalClient = (function () {
|
|||||||
|
|
||||||
var timeout = null;
|
var timeout = null;
|
||||||
|
|
||||||
var check = function check(m) {
|
var check = function check(data) {
|
||||||
var data = JSON.parse(m);
|
|
||||||
|
|
||||||
if (data.t === "VOICE_SERVER_UPDATE") {
|
if (data.t === "VOICE_SERVER_UPDATE") {
|
||||||
if (data.d.guild_id !== server.id) return; // ensure it is the right server
|
if (data.d.guild_id !== server.id) return; // ensure it is the right server
|
||||||
token = data.d.token;
|
token = data.d.token;
|
||||||
@@ -389,16 +387,16 @@ var InternalClient = (function () {
|
|||||||
if (timeout) {
|
if (timeout) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
_this5.websocket.removeListener("message", check);
|
_this5.client.removeListener("raw", check);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
timeout = setTimeout(function () {
|
timeout = setTimeout(function () {
|
||||||
_this5.websocket.removeListener("message", check);
|
_this5.client.removeListener("raw", check);
|
||||||
reject(new Error("No voice server details within 10 seconds"));
|
reject(new Error("No voice server details within 10 seconds"));
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
_this5.websocket.on("message", check);
|
_this5.client.on("raw", check);
|
||||||
joinSendWS();
|
joinSendWS();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -290,9 +290,7 @@ export default class InternalClient {
|
|||||||
|
|
||||||
var timeout = null;
|
var timeout = null;
|
||||||
|
|
||||||
var check = m => {
|
var check = data => {
|
||||||
var data = JSON.parse(m);
|
|
||||||
|
|
||||||
if (data.t === "VOICE_SERVER_UPDATE") {
|
if (data.t === "VOICE_SERVER_UPDATE") {
|
||||||
if (data.d.guild_id !== server.id) return // ensure it is the right server
|
if (data.d.guild_id !== server.id) return // ensure it is the right server
|
||||||
token = data.d.token;
|
token = data.d.token;
|
||||||
@@ -309,16 +307,16 @@ export default class InternalClient {
|
|||||||
if (timeout) {
|
if (timeout) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
}
|
}
|
||||||
this.websocket.removeListener("message", check);
|
this.client.removeListener("raw", check);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
timeout = setTimeout(() => {
|
timeout = setTimeout(() => {
|
||||||
this.websocket.removeListener("message", check);
|
this.client.removeListener("raw", check);
|
||||||
reject(new Error("No voice server details within 10 seconds"));
|
reject(new Error("No voice server details within 10 seconds"));
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
this.websocket.on("message", check);
|
this.client.on("raw", check);
|
||||||
joinSendWS();
|
joinSendWS();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user