mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
Expose VoiceBroadcast#dispatcher so that the broadcast can be controlled
This commit is contained in:
@@ -28,6 +28,14 @@ class VoiceBroadcast extends EventEmitter {
|
|||||||
this.player = new BroadcastAudioPlayer(this);
|
this.player = new BroadcastAudioPlayer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current master dispatcher, if any. This dispatcher controls all that is played by subscribed dispatchers.
|
||||||
|
* @type {?BroadcastDispatcher}
|
||||||
|
*/
|
||||||
|
get dispatcher() {
|
||||||
|
return this.player.dispatcher;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays the given file in the voice connection.
|
* Plays the given file in the voice connection.
|
||||||
* @param {string} file The absolute path to the file
|
* @param {string} file The absolute path to the file
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class AudioPlayer extends BasePlayer {
|
|||||||
|
|
||||||
createDispatcher(options, streams) {
|
createDispatcher(options, streams) {
|
||||||
this.destroyDispatcher();
|
this.destroyDispatcher();
|
||||||
const dispatcher = new BroadcastDispatcher(this, options, streams);
|
const dispatcher = this.dispatcher = new BroadcastDispatcher(this, options, streams);
|
||||||
return dispatcher;
|
return dispatcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user