mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
voice: use getters where possible
This commit is contained in:
@@ -36,12 +36,6 @@ class VoiceConnection extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
this.voiceManager = voiceManager;
|
this.voiceManager = voiceManager;
|
||||||
|
|
||||||
/**
|
|
||||||
* The client that instantiated this connection
|
|
||||||
* @type {Client}
|
|
||||||
*/
|
|
||||||
this.client = voiceManager.client;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The voice channel this connection is currently serving
|
* The voice channel this connection is currently serving
|
||||||
* @type {VoiceChannel}
|
* @type {VoiceChannel}
|
||||||
@@ -116,6 +110,14 @@ class VoiceConnection extends EventEmitter {
|
|||||||
this.authenticate();
|
this.authenticate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The client that instantiated this connection
|
||||||
|
* @type {Client}
|
||||||
|
*/
|
||||||
|
get client() {
|
||||||
|
return this.voiceManager.client;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current stream dispatcher (if any)
|
* The current stream dispatcher (if any)
|
||||||
* @type {?StreamDispatcher}
|
* @type {?StreamDispatcher}
|
||||||
|
|||||||
@@ -11,13 +11,6 @@ const WebSocket = require('../../../WebSocket');
|
|||||||
class VoiceWebSocket extends EventEmitter {
|
class VoiceWebSocket extends EventEmitter {
|
||||||
constructor(connection) {
|
constructor(connection) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
/**
|
|
||||||
* The client of this voice WebSocket
|
|
||||||
* @type {Client}
|
|
||||||
*/
|
|
||||||
this.client = connection.voiceManager.client;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Voice Connection that this WebSocket serves
|
* The Voice Connection that this WebSocket serves
|
||||||
* @type {VoiceConnection}
|
* @type {VoiceConnection}
|
||||||
@@ -35,6 +28,14 @@ class VoiceWebSocket extends EventEmitter {
|
|||||||
this.connection.on('closing', this.shutdown.bind(this));
|
this.connection.on('closing', this.shutdown.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The client of this voice WebSocket
|
||||||
|
* @type {Client}
|
||||||
|
*/
|
||||||
|
get client() {
|
||||||
|
return this.connection.voiceManager.client;
|
||||||
|
}
|
||||||
|
|
||||||
shutdown() {
|
shutdown() {
|
||||||
this.dead = true;
|
this.dead = true;
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|||||||
Reference in New Issue
Block a user