From 0bc76867339f00f5885cd29dd30e698854260cb2 Mon Sep 17 00:00:00 2001 From: Supositware Date: Fri, 18 Jan 2019 22:13:06 +0100 Subject: [PATCH] test --- commands/general/ttsvc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/general/ttsvc.js b/commands/general/ttsvc.js index 17ed1e4..5647cf3 100644 --- a/commands/general/ttsvc.js +++ b/commands/general/ttsvc.js @@ -57,11 +57,9 @@ class TtsvcCommand extends Command { console.log('Audio content written to file: ttsvc.mp3'); // If not in voice channel ask user to join - if (!voiceChannel) { - return message.reply('please join a voice channel first!'); - } else { // you should be careful in what is included in your scopes, you didn't use the {} - // If user say "stop" make the bot leave voice channel + if (message.member.voice.channel) { + const connection = await message.member.voice.channel.join(); if (text == 'stop') { voiceChannel.leave(); message.channel.send('I leaved the channel'); @@ -74,6 +72,8 @@ class TtsvcCommand extends Command { }, 2000)); }); } + } else { + message.reply('You need to join a voice channel first!'); } }); });