mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Handle incomplete websocket message (#413)
Sometimes the VOICE_SERVER_UPDATE packet will contain a valid guild_id but no token/endpoint.
This commit is contained in:
@@ -292,9 +292,10 @@ export default class InternalClient {
|
||||
|
||||
var check = data => {
|
||||
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;
|
||||
endpoint = data.d.endpoint;
|
||||
if (!token || !endpoint) return;
|
||||
var chan = new VoiceConnection(
|
||||
channel, this.client, session, token, server, endpoint
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user