Update voiceConnections on destroy

Instead of manually removing VoiceConnections from
InternalClient.voiceConnections, just integrate the functionality into
VoiceConnection.destroy()
This commit is contained in:
Programmix
2016-04-10 13:49:13 -07:00
parent b6d1cb88cd
commit afde031267
4 changed files with 2 additions and 4 deletions

View File

@@ -250,7 +250,6 @@ var InternalClient = (function () {
var leave = function leave(connection) {
return new Promise(function (resolve, reject) {
connection.destroy();
_this3.voiceConnections.remove(connection);
resolve();
});
};
@@ -280,7 +279,6 @@ var InternalClient = (function () {
// preserve old functionality for non-bots
if (this.voiceConnections[0]) {
this.voiceConnections[0].destroy();
this.voiceConnections.remove(this.voiceConnections[0]);
}
return Promise.resolve();
}