mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
voice: more debug
This commit is contained in:
@@ -68,13 +68,13 @@ class VoiceWebSocket extends EventEmitter {
|
||||
}
|
||||
|
||||
this.attempts++;
|
||||
this.emit('debug', `[WS] connecting, ${this.attempts} attempts, wss://${this.connection.authentication.endpoint}/`);
|
||||
|
||||
/**
|
||||
* The actual WebSocket used to connect to the Voice WebSocket Server.
|
||||
* @type {WebSocket}
|
||||
*/
|
||||
this.ws = WebSocket.create(`wss://${this.connection.authentication.endpoint}/`, { v: 4 });
|
||||
this.emit('debug', `[WS] connecting, ${this.attempts} attempts, ${this.ws.url}`);
|
||||
this.ws.onopen = this.onOpen.bind(this);
|
||||
this.ws.onmessage = this.onMessage.bind(this);
|
||||
this.ws.onclose = this.onClose.bind(this);
|
||||
@@ -154,6 +154,7 @@ class VoiceWebSocket extends EventEmitter {
|
||||
* @param {Error} error The error that occurred
|
||||
*/
|
||||
onError(error) {
|
||||
this.emit('debug', `[WS] Error: ${error}`);
|
||||
this.emit('error', error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user