From ca96e1478a4123302bb5811b3f1d1ebffe5e1438 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Sat, 20 Jan 2018 13:45:22 +0000 Subject: [PATCH] Make docs technically correct --- src/client/voice/VoiceBroadcast.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/client/voice/VoiceBroadcast.js b/src/client/voice/VoiceBroadcast.js index 6258cd4d..e81157ec 100644 --- a/src/client/voice/VoiceBroadcast.js +++ b/src/client/voice/VoiceBroadcast.js @@ -38,7 +38,27 @@ class VoiceBroadcast extends EventEmitter { return this.player.dispatcher; } - play() {} // eslint-disable-line no-empty-function + /** + * Play an audio resource. + * @param {ReadableStream|string} resource The resource to play. + * @param {StreamOptions} [options] The options to play. + * @example + * // Play a local audio file + * connection.play('/home/hydrabolt/audio.mp3', { volume: 0.5 }); + * @example + * // Play a ReadableStream + * connection.play(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { filter: 'audioonly' })); + * @example + * // Play a voice broadcast + * const broadcast = client.createVoiceBroadcast(); + * broadcast.play('/home/hydrabolt/audio.mp3'); + * connection.play(broadcast); + * @example + * // Using different protocols: https://ffmpeg.org/ffmpeg-protocols.html + * connection.play('http://www.sample-videos.com/audio/mp3/wave.mp3'); + * @returns {BroadcastDispatcher} + */ + play() { return null; } } PlayInterface.applyToClass(VoiceBroadcast);