Voice Connection docs

This commit is contained in:
Amish Shah
2016-12-30 17:44:05 +00:00
parent f31a3725fe
commit 221e7f8b21
2 changed files with 12 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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');