From e9f70c4eb9f58c09c4d7d5e495dadef800673d58 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Sun, 30 Dec 2018 04:23:45 +0100 Subject: [PATCH] --- commands/general/ttsvc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/general/ttsvc.js b/commands/general/ttsvc.js index c7292e2b..e1388019 100644 --- a/commands/general/ttsvc.js +++ b/commands/general/ttsvc.js @@ -62,12 +62,14 @@ class TtsvcCommand extends Command { // If user say "stop" make the bot leave voice channel if (text == 'stop') { voiceChannel.leave(); - message.channel.send('I left the channel'); + message.channel.send('I leaved the channel'); } else voiceChannel.join().then(connection => { const dispatcher = connection.playStream('./ttsvc.mp3'); // End at then end of the audio stream - dispatcher.on('end', () => voiceChannel.leave()) + dispatcher.on('end', () => setTimeout(function(){ + voiceChannel.leave(); + }, 2000)); }); }); });