diff --git a/lib/Voice/VoiceConnection.js b/lib/Voice/VoiceConnection.js index 4607abb4b..83c14f370 100644 --- a/lib/Voice/VoiceConnection.js +++ b/lib/Voice/VoiceConnection.js @@ -94,8 +94,6 @@ var VoiceConnection = (function (_EventEmitter) { if (this.KAI) { clearInterval(this.KAI); } - this.vWS.close(); - this.udp.close(); this.client.internal.sendWS({ op: 4, d: { @@ -106,6 +104,12 @@ var VoiceConnection = (function (_EventEmitter) { } }); this.client.internal.voiceConnections.remove(this); + try { + this.vWS.close(); + } catch (e) {} + try { + this.udp.close(); + } catch (e) {} }; VoiceConnection.prototype.stopPlaying = function stopPlaying() { diff --git a/src/Voice/VoiceConnection.js b/src/Voice/VoiceConnection.js index 76d93207b..f0e685332 100644 --- a/src/Voice/VoiceConnection.js +++ b/src/Voice/VoiceConnection.js @@ -56,8 +56,6 @@ export default class VoiceConnection extends EventEmitter { if (this.KAI) { clearInterval(this.KAI); } - this.vWS.close(); - this.udp.close(); this.client.internal.sendWS( { op : 4, @@ -70,6 +68,12 @@ export default class VoiceConnection extends EventEmitter { } ); this.client.internal.voiceConnections.remove(this); + try { + this.vWS.close(); + } catch(e) {} + try { + this.udp.close(); + } catch(e) {} } stopPlaying() {