1
0
Fork 0

Updated description

Commando
Loïc Bersier 6 years ago
parent c092aacda2
commit 557fb214ca

@ -19,20 +19,20 @@ module.exports = class MusicCommand extends Command {
run(message, { ytblink }) {
const { voiceChannel } = message.member;
if (!voiceChannel) {
return message.reply('please join a voice channel first!');
if (!voiceChannel) {
return message.reply('please join a voice channel first!');
}
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());
});
}
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