aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2022-03-25 23:01:06 -0400
committerAndrew Lee <alee14498@protonmail.com>2022-03-25 23:01:06 -0400
commit626f84e654b217e4e0886d173f9ced4b0108572a (patch)
treeedc5966eb279893742b6c3f90366a504a51b1cdd /bot.js
parent838bc8f15853561f25ffd5aaebdef6213468e868 (diff)
downloadDLAP-626f84e654b217e4e0886d173f9ced4b0108572a.tar.gz
DLAP-626f84e654b217e4e0886d173f9ced4b0108572a.tar.bz2
DLAP-626f84e654b217e4e0886d173f9ced4b0108572a.zip
Forgot to add this
Diffstat (limited to 'bot.js')
-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);