Clean up a bunch of new voice stuff

This commit is contained in:
Schuyler Cebulskie
2016-10-25 20:26:57 -04:00
parent a04094f0ff
commit d1e9d15a1c
9 changed files with 57 additions and 76 deletions

View File

@@ -129,12 +129,8 @@ class VoiceConnection extends EventEmitter {
* @private
*/
connect() {
if (this.sockets.ws) {
throw new Error('There is already an existing WebSocket connection!');
}
if (this.sockets.udp) {
throw new Error('There is already an existing UDP connection!');
}
if (this.sockets.ws) throw new Error('There is already an existing WebSocket connection.');
if (this.sockets.udp) throw new Error('There is already an existing UDP connection.');
this.sockets.ws = new VoiceWebSocket(this);
this.sockets.udp = new VoiceUDP(this);
this.sockets.ws.on('error', e => this.emit('error', e));
@@ -260,7 +256,6 @@ class VoiceConnection extends EventEmitter {
this.receivers.push(receiver);
return receiver;
}
}
module.exports = VoiceConnection;