mirror of
https://github.com/danbulant/discord.js
synced 2026-07-10 13:41:42 +00:00
Voice Connection docs
This commit is contained in:
parent
f31a3725fe
commit
221e7f8b21
2 changed files with 12 additions and 0 deletions
|
|
@ -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');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue