voice: use getters where possible

This commit is contained in:
Amish Shah
2018-06-22 18:46:51 +01:00
parent 08bbbe9301
commit 18646b72f9
2 changed files with 16 additions and 13 deletions

View File

@@ -11,13 +11,6 @@ const WebSocket = require('../../../WebSocket');
class VoiceWebSocket extends EventEmitter {
constructor(connection) {
super();
/**
* The client of this voice WebSocket
* @type {Client}
*/
this.client = connection.voiceManager.client;
/**
* The Voice Connection that this WebSocket serves
* @type {VoiceConnection}
@@ -35,6 +28,14 @@ class VoiceWebSocket extends EventEmitter {
this.connection.on('closing', this.shutdown.bind(this));
}
/**
* The client of this voice WebSocket
* @type {Client}
*/
get client() {
return this.connection.voiceManager.client;
}
shutdown() {
this.dead = true;
this.reset();