mirror of
https://github.com/danbulant/discord.js
synced 2026-07-13 07:00:44 +00:00
fix(playinterface): lazy require VoiceBroadcast to avoid circul… (#3864)
This commit is contained in:
parent
acdd832fe2
commit
713309e7bb
1 changed files with 2 additions and 4 deletions
|
|
@ -60,7 +60,8 @@ class PlayInterface {
|
||||||
* @returns {StreamDispatcher}
|
* @returns {StreamDispatcher}
|
||||||
*/
|
*/
|
||||||
play(resource, options = {}) {
|
play(resource, options = {}) {
|
||||||
if (resource instanceof Broadcast) {
|
const VoiceBroadcast = require('../VoiceBroadcast');
|
||||||
|
if (resource instanceof VoiceBroadcast) {
|
||||||
if (!this.player.playBroadcast) throw new Error('VOICE_PLAY_INTERFACE_NO_BROADCAST');
|
if (!this.player.playBroadcast) throw new Error('VOICE_PLAY_INTERFACE_NO_BROADCAST');
|
||||||
return this.player.playBroadcast(resource, options);
|
return this.player.playBroadcast(resource, options);
|
||||||
}
|
}
|
||||||
|
|
@ -91,6 +92,3 @@ class PlayInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = PlayInterface;
|
module.exports = PlayInterface;
|
||||||
|
|
||||||
// eslint-disable-next-line import/order
|
|
||||||
const Broadcast = require('../VoiceBroadcast');
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue