From 626f84e654b217e4e0886d173f9ced4b0108572a Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Fri, 25 Mar 2022 23:01:06 -0400 Subject: Forgot to add this --- bot.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bot.js b/bot.js index 393b25f..5416cf6 100644 --- a/bot.js +++ b/bot.js @@ -193,11 +193,13 @@ bot.on('messageCreate', async msg => { if (command === 'leave') { msg.reply('Leaving voice channel.'); console.log('Leaving voice channel.'); - fileData = "Now Playing: Nothing"; - fs.writeFile("now-playing.txt", fileData, (err) => { - if (err) - console.log(err); - }); + if (txtFile === true) { + fileData = "Now Playing: Nothing"; + fs.writeFile("now-playing.txt", fileData, (err) => { + if (err) + console.log(err); + }); + } audio = "Not Playing"; player.stop(); const connection = getVoiceConnection(msg.guild.id); -- cgit v1.2.3