Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.run = (client, msg, args) => {
- var voiceChannel = msg.member.voiceChannel;
- var textChannel = msg.channel;
- var path = './audio/american-dream.mp3';
- voiceChannel.join().then(connection => {
- const dispatcher = connection.playFile(path);
- dispatcher.on("end", () => {
- connection.disconnect();
- voiceChannel.leave();
- });
- }).catch(error => {
- textChannel.send(error.toString());
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement