This commit is contained in:
Loic Bersier 2018-12-09 01:58:00 +01:00
parent c003e27609
commit 8c085d9e57

View file

@ -27,6 +27,8 @@ module.exports = class ttsvcCommand extends Command {
if(blacklistJson[message.author.id]) if(blacklistJson[message.author.id])
return blacklist(blacklistJson[message.author.id] , message) return blacklist(blacklistJson[message.author.id] , message)
voiceChannel.leave();
// Construct the request // Construct the request
const request = { const request = {
input: {text: text}, input: {text: text},
@ -65,8 +67,6 @@ module.exports = class ttsvcCommand extends Command {
} else } else
voiceChannel.join().then(connection => { voiceChannel.join().then(connection => {
const dispatcher = connection.playStream('./tts.mp3'); const dispatcher = connection.playStream('./tts.mp3');
// End at then end of the audio stream
dispatcher.on('end', () => voiceChannel.leave());
}); });
}); });
}); });