mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
Clean up AudioPlayer internals, change currentDispatcher and currentTranscoder to just dispatcher and transcoder
This commit is contained in:
@@ -47,7 +47,12 @@ class AudioPlayer extends EventEmitter {
|
|||||||
this.voiceConnection.once('closing', () => this.destroyAllStreams());
|
this.voiceConnection.once('closing', () => this.destroyAllStreams());
|
||||||
}
|
}
|
||||||
|
|
||||||
get currentTranscoder() {
|
/**
|
||||||
|
* The current transcoder
|
||||||
|
* @type {?Object}
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
get transcoder() {
|
||||||
return this.currentStream.transcoder;
|
return this.currentStream.transcoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +61,7 @@ class AudioPlayer extends EventEmitter {
|
|||||||
* @type {?StreamDispatcher}
|
* @type {?StreamDispatcher}
|
||||||
* @readonly
|
* @readonly
|
||||||
*/
|
*/
|
||||||
get currentDispatcher() {
|
get dispatcher() {
|
||||||
return this.currentStream.dispatcher;
|
return this.currentStream.dispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +70,8 @@ class AudioPlayer extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroyCurrentStream() {
|
destroyCurrentStream() {
|
||||||
const transcoder = this.currentTranscoder;
|
const transcoder = this.transcoder;
|
||||||
const dispatcher = this.currentDispatcher;
|
const dispatcher = this.dispatcher;
|
||||||
if (transcoder) transcoder.kill();
|
if (transcoder) transcoder.kill();
|
||||||
if (dispatcher) dispatcher.destroy('end');
|
if (dispatcher) dispatcher.destroy('end');
|
||||||
this.currentStream = {};
|
this.currentStream = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user