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