From 657980d6eb3c6aea491332ac0e1177adf88c19ce Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Sun, 9 Dec 2018 01:44:44 +0100 Subject: [PATCH] await a little before quiting channel --- commands/fun/ttsvc.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/fun/ttsvc.js b/commands/fun/ttsvc.js index a3b92013..43c42b43 100644 --- a/commands/fun/ttsvc.js +++ b/commands/fun/ttsvc.js @@ -67,7 +67,7 @@ module.exports = class ttsvcCommand extends Command { const stream = "./tts.mp3" const dispatcher = connection.playStream('./tts.mp3'); // End at then end of the audio stream - dispatcher.on('end', () => voiceChannel.leave()); + await dispatcher.on('end', () => voiceChannel.leave()); }); }); }); diff --git a/package.json b/package.json index 1d00a104..a46b5317 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "google-tts-api": "0.0.4", "node-fetch": "^2.2.0", "node-gyp": "^3.8.0", + "node-opus": "^0.3.1", "printer": "^0.2.2", "self-reload-json": "^0.4.0", "superagent": "^4.0.0-beta.5",