aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.js12
1 files 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);