From afaa91330adef8a8cd1b181c750e71a9fedc1f63 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sat, 6 Apr 2019 21:05:46 +0200 Subject: [PATCH] Removed "leaved" and made thing a little better --- commands/utility/play.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/commands/utility/play.js b/commands/utility/play.js index 85192433..d2ca2836 100644 --- a/commands/utility/play.js +++ b/commands/utility/play.js @@ -33,14 +33,17 @@ class playCommand extends Command { // If user say "stop" make the bot leave voice channel if (args.ytblink == 'stop') { voiceChannel.leave(); - message.channel.send('I leaved the channel'); + return message.channel.send('I left the channel'); } else voiceChannel.join().then(connection => { const stream = ytdl(args.ytblink, { filter: 'audioonly' }); const dispatcher = connection.play(stream); + message.channel.send('Playing it now!'); // End at then end of the audio stream - dispatcher.on('end', () => voiceChannel.leave()); - message.channel.send('Music ended, Leaved the channel'); + dispatcher.on('end', () => { + voiceChannel.leave(); + return message.channel.send('Music ended, i left the channel'); + }); }); } }