mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
Catch udp close errors
This commit is contained in:
parent
9015bb8139
commit
3fa3b0238e
2 changed files with 12 additions and 4 deletions
|
|
@ -94,8 +94,6 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||||
if (this.KAI) {
|
if (this.KAI) {
|
||||||
clearInterval(this.KAI);
|
clearInterval(this.KAI);
|
||||||
}
|
}
|
||||||
this.vWS.close();
|
|
||||||
this.udp.close();
|
|
||||||
this.client.internal.sendWS({
|
this.client.internal.sendWS({
|
||||||
op: 4,
|
op: 4,
|
||||||
d: {
|
d: {
|
||||||
|
|
@ -106,6 +104,12 @@ var VoiceConnection = (function (_EventEmitter) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.client.internal.voiceConnections.remove(this);
|
this.client.internal.voiceConnections.remove(this);
|
||||||
|
try {
|
||||||
|
this.vWS.close();
|
||||||
|
} catch (e) {}
|
||||||
|
try {
|
||||||
|
this.udp.close();
|
||||||
|
} catch (e) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
VoiceConnection.prototype.stopPlaying = function stopPlaying() {
|
VoiceConnection.prototype.stopPlaying = function stopPlaying() {
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
if (this.KAI) {
|
if (this.KAI) {
|
||||||
clearInterval(this.KAI);
|
clearInterval(this.KAI);
|
||||||
}
|
}
|
||||||
this.vWS.close();
|
|
||||||
this.udp.close();
|
|
||||||
this.client.internal.sendWS(
|
this.client.internal.sendWS(
|
||||||
{
|
{
|
||||||
op : 4,
|
op : 4,
|
||||||
|
|
@ -70,6 +68,12 @@ export default class VoiceConnection extends EventEmitter {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.client.internal.voiceConnections.remove(this);
|
this.client.internal.voiceConnections.remove(this);
|
||||||
|
try {
|
||||||
|
this.vWS.close();
|
||||||
|
} catch(e) {}
|
||||||
|
try {
|
||||||
|
this.udp.close();
|
||||||
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
stopPlaying() {
|
stopPlaying() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue