From 221e7f8b216fe6a029fe96ae9c0a419ca15e1431 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Fri, 30 Dec 2016 17:44:05 +0000 Subject: [PATCH] Voice Connection docs --- src/client/voice/VoiceConnection.js | 11 +++++++++++ src/client/voice/dispatcher/StreamDispatcher.js | 1 + 2 files changed, 12 insertions(+) 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');