Added a standard work week status updater

This commit is contained in:
2019-06-11 09:39:38 +10:00
parent 0949ab7469
commit 6d77d209f9
4 changed files with 696 additions and 2 deletions

View File

@@ -1,6 +1,18 @@
const moment = require("moment")
const fs = require('fs')
module.exports = {
name: "Auto Voice Channel",
name: "Nine to Five",
init: (dclient) => {
return
client = dclient
setInterval(on15Update, 900000)
function on15Update() {
var currentUpdate = Math.round((moment().day() * 24 * 60 + (moment().hour() * 60) + moment().minute()) / 15)
fs.readFile("workweek.json", "utf8", function (err, data) {
let workweek = JSON.parse(data)
client.user.setActivity(workweek.workweek[currentUpdate], { type: 'PLAYING' })
})
}
on15Update()
}
}