buddy

node MVC discord bot
Log | Files | Refs | README

AudioPlayer.js (579B)


      1 'use strict';
      2 
      3 const BasePlayer = require('./BasePlayer');
      4 
      5 /**
      6  * An Audio Player for a Voice Connection.
      7  * @private
      8  * @extends {BasePlayer}
      9  */
     10 class AudioPlayer extends BasePlayer {
     11   constructor(voiceConnection) {
     12     super();
     13     /**
     14      * The voice connection that the player serves
     15      * @type {VoiceConnection}
     16      */
     17     this.voiceConnection = voiceConnection;
     18   }
     19 
     20   playBroadcast(broadcast, options) {
     21     const dispatcher = this.createDispatcher(options, { broadcast });
     22     broadcast.add(dispatcher);
     23     return dispatcher;
     24   }
     25 }
     26 
     27 module.exports = AudioPlayer;