fix(Voice*): internally disconnect and cleanup when forcibly disconnected (#3597)

This commit is contained in:
SpaceEEC
2020-01-05 18:10:20 +01:00
committed by GitHub
parent 1d6606293a
commit cbabc1663c
3 changed files with 19 additions and 4 deletions

View File

@@ -30,10 +30,15 @@ class ClientVoiceManager {
onVoiceStateUpdate({ guild_id, session_id, channel_id }) {
const connection = this.connections.get(guild_id);
if (connection) {
connection.channel = this.client.channels.get(channel_id);
connection.setSessionID(session_id);
if (!connection) return;
if (!channel_id) {
connection._disconnect();
this.connections.delete(guild_id);
return;
}
connection.channel = this.client.channels.get(channel_id);
connection.setSessionID(session_id);
}
/**