mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
Fixes disconnecting VoiceConnections before connected (#1227)
This commit is contained in:
@@ -311,11 +311,18 @@ class VoiceConnection extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
cleanup() {
|
cleanup() {
|
||||||
const { ws, udp } = this.sockets;
|
const { ws, udp } = this.sockets;
|
||||||
ws.removeAllListeners('error');
|
|
||||||
udp.removeAllListeners('error');
|
if (ws) {
|
||||||
ws.removeAllListeners('ready');
|
ws.removeAllListeners('error');
|
||||||
ws.removeAllListeners('sessionDescription');
|
ws.removeAllListeners('ready');
|
||||||
ws.removeAllListeners('speaking');
|
ws.removeAllListeners('sessionDescription');
|
||||||
|
ws.removeAllListeners('speaking');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (udp) {
|
||||||
|
udp.removeAllListeners('error');
|
||||||
|
}
|
||||||
|
|
||||||
this.sockets.ws = null;
|
this.sockets.ws = null;
|
||||||
this.sockets.udp = null;
|
this.sockets.udp = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user