Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.run = (client, msg, args) => {
  2.  
  3.     var voiceChannel = msg.member.voiceChannel;
  4.     var textChannel = msg.channel;
  5.     var path = './audio/american-dream.mp3';
  6.  
  7.     voiceChannel.join().then(connection => {
  8.  
  9.     const dispatcher = connection.playFile(path);
  10.     dispatcher.on("end", () => {
  11.         connection.disconnect();
  12.         voiceChannel.leave();
  13.     });
  14.  
  15.   }).catch(error => {
  16.       textChannel.send(error.toString());
  17.   });
  18. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement