forked from Supositware/Haha-Yes
test
This commit is contained in:
parent
578881e3dd
commit
bee00ef40e
1 changed files with 6 additions and 13 deletions
|
@ -56,19 +56,12 @@ class TtsvcCommand extends Command {
|
||||||
// If not in voice channel ask user to join
|
// If not in voice channel ask user to join
|
||||||
|
|
||||||
if (message.member.voice.channel) {
|
if (message.member.voice.channel) {
|
||||||
const voiceChannel = message.member.voice.channel.join();
|
const connection = message.member.voice.channel.join();
|
||||||
if (text == 'stop') {
|
const dispatcher = connection.play('./ttsvc');
|
||||||
voiceChannel.leave();
|
|
||||||
message.channel.send('I leaved the channel');
|
dispatcher.on('finish', () => {
|
||||||
} else { // you should be careful in what is included in your scopes, you didn't use the {}
|
connection.leave();
|
||||||
voiceChannel.join().then(connection => {
|
});
|
||||||
const dispatcher = connection.playStream('./ttsvc.mp3');
|
|
||||||
// End at then end of the audio stream
|
|
||||||
dispatcher.on('end', () => setTimeout(function () {
|
|
||||||
voiceChannel.leave();
|
|
||||||
}, 2000));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
message.reply('You need to join a voice channel first!');
|
message.reply('You need to join a voice channel first!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue