From cc1221b0a248bba1c7d32b69b377f2064e68fba8 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Tue, 18 Sep 2018 14:16:54 +0200 Subject: [PATCH] --- commands/fun/music.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/fun/music.js b/commands/fun/music.js index db1fd73..378848c 100644 --- a/commands/fun/music.js +++ b/commands/fun/music.js @@ -20,7 +20,7 @@ module.exports = class MusicCommand extends Command { }); } - async run(message, { ytblink }) { + async run(message, { ytblink, repeat }) { const { voiceChannel } = message.member; // If not in voice channel ask user to join @@ -31,14 +31,12 @@ module.exports = class MusicCommand extends Command { // If user say "stop" make the bot leave voice channel if (ytblink == 'stop') { voiceChannel.leave() - } else + } else voiceChannel.join().then(connection => { const stream = ytdl(ytblink, { filter: 'audioonly' }); const dispatcher = connection.playStream(stream); - // End at then end of the audio stream dispatcher.on('end', () => voiceChannel.leave()); }); - } } \ No newline at end of file