From 9309c76b9dd2f34545492b21268cfedc5268460b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Sat, 8 Sep 2018 00:33:27 +0200 Subject: [PATCH] --- commands/fun/music.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/fun/music.js b/commands/fun/music.js index 42dfa0e2..73effbe5 100644 --- a/commands/fun/music.js +++ b/commands/fun/music.js @@ -20,13 +20,13 @@ module.exports = class MusicCommand extends Command { run(message, { ytblink }) { const { voiceChannel } = message.member; + if (ytblink == 'stop') { + voiceChannel.leave() + } else 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);