mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
28 lines
579 B
JavaScript
28 lines
579 B
JavaScript
'use strict';
|
|
|
|
const BasePlayer = require('./BasePlayer');
|
|
|
|
/**
|
|
* An Audio Player for a Voice Connection.
|
|
* @private
|
|
* @extends {BasePlayer}
|
|
*/
|
|
class AudioPlayer extends BasePlayer {
|
|
constructor(voiceConnection) {
|
|
super();
|
|
/**
|
|
* The voice connection that the player serves
|
|
* @type {VoiceConnection}
|
|
*/
|
|
this.voiceConnection = voiceConnection;
|
|
}
|
|
|
|
playBroadcast(broadcast, options) {
|
|
const dispatcher = this.createDispatcher(options, { broadcast });
|
|
broadcast.add(dispatcher);
|
|
return dispatcher;
|
|
}
|
|
}
|
|
|
|
module.exports = AudioPlayer;
|