From 1a3ce126385006c288d26ae60ee2e01c88f6eb2b Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Sun, 9 Dec 2018 02:06:38 +0100 Subject: [PATCH] testing somethign else --- commands/fun/ttsvc.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/fun/ttsvc.js b/commands/fun/ttsvc.js index 32350d31..33e32b97 100644 --- a/commands/fun/ttsvc.js +++ b/commands/fun/ttsvc.js @@ -63,8 +63,7 @@ module.exports = class ttsvcCommand extends Command { voiceChannel.leave() message.say('I leaved the channel'); } else - voiceChannel.join().then(connection => { - const dispatcher = connection.playStream('./tts.mp3'); + voiceChannel.join().then(connection =>{const dispatcher = connection.playFile('./tts.mp3');}).catch(err => console.log(err)); + dispatcher.on("end", end => {voiceChannel.leave();}); }); - }); -})}} \ No newline at end of file + })}} \ No newline at end of file