voice: more debug info

This commit is contained in:
Amish Shah
2019-02-11 17:57:56 +00:00
parent 283fc54ce4
commit 810b5a5f71
2 changed files with 4 additions and 1 deletions

View File

@@ -28,12 +28,14 @@ class ClientVoiceManager {
}
onVoiceServer({ guild_id, token, endpoint }) {
this.client.emit('debug', `[VOICE] voiceServer guild: ${guild_id} token: ${token} endpoint: ${endpoint}`);
const connection = this.connections.get(guild_id);
if (connection) connection.setTokenAndEndpoint(token, endpoint);
}
onVoiceStateUpdate({ guild_id, session_id, channel_id }) {
const connection = this.connections.get(guild_id);
this.client.emit('debug', `[VOICE] connection? ${!!connection}, ${guild_id} ${session_id} ${channel_id}`);
if (!connection) return;
if (!channel_id && connection.status !== VoiceStatus.DISCONNECTED) {
connection._disconnect();