1
0
Fork 0
Loïc Bersier 6 years ago
parent d9f33d3368
commit d34c2d7a19

@ -23,13 +23,14 @@ module.exports = class MusicCommand extends Command {
if (!voiceChannel) {
return message.reply('please join a voice channel first!');
}
voiceChannel.join().then(connection => {
const stream = ytdl(ytblink, { filter: 'audioonly' });
const dispatcher = connection.playStream(stream);
if (ytblink == 'stop') {
voiceChannel.leave()
} else
voiceChannel.join().then(connection => {
const stream = ytdl(ytblink, { filter: 'audioonly' });
const dispatcher = connection.playStream(stream);
dispatcher.on('end', () => voiceChannel.leave());
});

Loading…
Cancel
Save