mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
voice: more debug
This commit is contained in:
parent
fe51b4e89b
commit
c362ba0dd5
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue