Added a new feature

This commit is contained in:
Andrew Lee 2020-12-23 19:35:38 -05:00
parent aa2a9501d9
commit 35d504a71f
Signed by: andrew
GPG key ID: 4DCE67C47836D125
2 changed files with 10 additions and 2 deletions

3
.gitignore vendored
View file

@ -2,4 +2,5 @@ config.json
node_modules
yarn.lock
music/*.mp3
package-lock.json
package-lock.json
now-playing.txt

9
bot.js
View file

@ -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')