mirror of
https://github.com/Alee14/DLAP.git
synced 2025-01-22 10:52:03 -05:00
Added a new feature
This commit is contained in:
parent
aa2a9501d9
commit
35d504a71f
2 changed files with 10 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,4 +2,5 @@ config.json
|
|||
node_modules
|
||||
yarn.lock
|
||||
music/*.mp3
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
now-playing.txt
|
||||
|
|
9
bot.js
9
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')
|
||||
|
|
Loading…
Reference in a new issue