aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-12-23 19:35:38 -0500
committerAndrew Lee <alee14498@protonmail.com>2020-12-23 19:35:38 -0500
commit35d504a71f52e2eecf87c4d1258d47292209d82e (patch)
tree959025609d984f30c1880552664ffd40230480dd
parentaa2a9501d911aab2bb0215c1f6b285c9048de83a (diff)
downloadDLAP-35d504a71f52e2eecf87c4d1258d47292209d82e.tar.gz
DLAP-35d504a71f52e2eecf87c4d1258d47292209d82e.tar.bz2
DLAP-35d504a71f52e2eecf87c4d1258d47292209d82e.zip
Added a new feature
-rw-r--r--.gitignore3
-rw-r--r--bot.js9
2 files changed, 10 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index ed0e29f..76a8036 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,5 @@ config.json
node_modules
yarn.lock
music/*.mp3
-package-lock.json \ No newline at end of file
+package-lock.json
+now-playing.txt
diff --git a/bot.js b/bot.js
index a559182..d9ac2d3 100644
--- a/bot.js
+++ b/bot.js
@@ -25,6 +25,7 @@ const config = require('./config.json');
let dispatcher;
let audio;
let voiceChannel;
+let writeTextFile = false;
bot.login(config.token);
@@ -47,7 +48,13 @@ function playAudio() {
dispatcher.on('start', () => {
console.log('Now playing ' + audio);
-
+ if writeTextFile == true {
+ let data = "Now Playing: " + audio;
+ fs.writeFile("now-playing.txt", data, (err) => {
+ if (err)
+ console.log(err);
+ });
+ }
const statusEmbed = new Discord.MessageEmbed()
.addField('Now Playing', `${audio}`)
.setColor('#0066ff')