mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
Expose VoiceBroadcast#dispatcher so that the broadcast can be controlled
This commit is contained in:
parent
e7375aa0fd
commit
3b1c5d3494
2 changed files with 9 additions and 1 deletions
|
|
@ -28,6 +28,14 @@ class VoiceBroadcast extends EventEmitter {
|
|||
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.
|
||||
* @param {string} file The absolute path to the file
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class AudioPlayer extends BasePlayer {
|
|||
|
||||
createDispatcher(options, streams) {
|
||||
this.destroyDispatcher();
|
||||
const dispatcher = new BroadcastDispatcher(this, options, streams);
|
||||
const dispatcher = this.dispatcher = new BroadcastDispatcher(this, options, streams);
|
||||
return dispatcher;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue