mirror of
https://github.com/danbulant/discord.js
synced 2026-06-19 06:31:20 +00: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:
parent
e59dd9b12a
commit
02f39e00bf
2 changed files with 3 additions and 1 deletions
|
|
@ -375,6 +375,7 @@ var InternalClient = (function () {
|
|||
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 _VoiceVoiceConnection2["default"](channel, _this5.client, session, token, server, endpoint);
|
||||
_this5.voiceConnections.add(chan);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue