mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 05:23:31 +01:00
Voice Connection docs
This commit is contained in:
@@ -273,6 +273,17 @@ class VoiceConnection extends EventEmitter {
|
|||||||
return this.player.playPCMStream(stream, options);
|
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) {
|
playBroadcast(broadcast) {
|
||||||
return this.player.playBroadcast(broadcast);
|
return this.player.playBroadcast(broadcast);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -301,6 +301,7 @@ class StreamDispatcher extends EventEmitter {
|
|||||||
if (!this.stream) {
|
if (!this.stream) {
|
||||||
/**
|
/**
|
||||||
* Emitted if the dispatcher encounters an error
|
* Emitted if the dispatcher encounters an error
|
||||||
|
* @event StreamDispatcher#error
|
||||||
* @param {string} error the error message
|
* @param {string} error the error message
|
||||||
*/
|
*/
|
||||||
this.emit('error', 'No stream');
|
this.emit('error', 'No stream');
|
||||||
|
|||||||
Reference in New Issue
Block a user