mirror of
https://github.com/danbulant/discord.js
synced 2026-06-06 08:11:50 +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);
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue