mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Update voiceConnections on destroy
Instead of manually removing VoiceConnections from InternalClient.voiceConnections, just integrate the functionality into VoiceConnection.destroy()
This commit is contained in:
@@ -180,7 +180,6 @@ export default class InternalClient {
|
||||
var leave = (connection) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
connection.destroy();
|
||||
this.voiceConnections.remove(connection);
|
||||
resolve();
|
||||
});
|
||||
};
|
||||
@@ -210,7 +209,6 @@ export default class InternalClient {
|
||||
// preserve old functionality for non-bots
|
||||
if (this.voiceConnections[0]) {
|
||||
this.voiceConnections[0].destroy();
|
||||
this.voiceConnections.remove(this.voiceConnections[0])
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ export default class VoiceConnection extends EventEmitter {
|
||||
}
|
||||
}
|
||||
);
|
||||
this.client.internal.voiceConnections.remove(this);
|
||||
}
|
||||
|
||||
stopPlaying() {
|
||||
|
||||
Reference in New Issue
Block a user