This commit is contained in:
Loic Bersier 2018-12-20 16:56:28 +01:00
parent ee4206b48e
commit 997acccd01

View file

@ -60,14 +60,14 @@ module.exports = class ttsvcCommand extends Command {
} else
// If user say "stop" make the bot leave voice channel
if (text == 'stop') {
voiceChannel.end()
voiceChannel.leave();
message.say('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', () => setTimeout(function(){
voiceChannel.end();
voiceChannel.leave();
}, 2000));
});
});