forked from Supositware/Haha-Yes
restored
This commit is contained in:
parent
ee4206b48e
commit
997acccd01
1 changed files with 2 additions and 2 deletions
|
@ -60,14 +60,14 @@ module.exports = class ttsvcCommand extends Command {
|
||||||
} else
|
} else
|
||||||
// If user say "stop" make the bot leave voice channel
|
// If user say "stop" make the bot leave voice channel
|
||||||
if (text == 'stop') {
|
if (text == 'stop') {
|
||||||
voiceChannel.end()
|
voiceChannel.leave();
|
||||||
message.say('I leaved the channel');
|
message.say('I leaved the channel');
|
||||||
} else
|
} else
|
||||||
voiceChannel.join().then(connection => {
|
voiceChannel.join().then(connection => {
|
||||||
const dispatcher = connection.playStream('./ttsvc.mp3');
|
const dispatcher = connection.playStream('./ttsvc.mp3');
|
||||||
// End at then end of the audio stream
|
// End at then end of the audio stream
|
||||||
dispatcher.on('end', () => setTimeout(function(){
|
dispatcher.on('end', () => setTimeout(function(){
|
||||||
voiceChannel.end();
|
voiceChannel.leave();
|
||||||
}, 2000));
|
}, 2000));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue