diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js index 60dc696e5..304769145 100644 --- a/src/client/voice/VoiceConnection.js +++ b/src/client/voice/VoiceConnection.js @@ -273,6 +273,17 @@ class VoiceConnection extends EventEmitter { return this.player.playPCMStream(stream, options); } + /** + * Plays a voice broadcast + * @param {VoiceBroadcast} broadcast the broadcast to play + * @returns {StreamDispatcher} + * @example + * // play a broadcast + * const broadcast = client + * .createVoiceBroadcast() + * .playFile('./test.mp3'); + * const dispatcher = voiceConnection.playBroadcast(broadcast); + */ playBroadcast(broadcast) { return this.player.playBroadcast(broadcast); } diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index bf283d513..5b14b88be 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -301,6 +301,7 @@ class StreamDispatcher extends EventEmitter { if (!this.stream) { /** * Emitted if the dispatcher encounters an error + * @event StreamDispatcher#error * @param {string} error the error message */ this.emit('error', 'No stream');