Updated modules + afk timer

This commit is contained in:
2019-06-11 10:16:07 +10:00
parent 16e9116308
commit 9f457e3507
3 changed files with 49 additions and 50 deletions

View File

@@ -6,7 +6,10 @@ module.exports = {
init: (dclient) => {
client = dclient
moment().utcOffset(0)
client.user.setStatus('idle')
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) {
@@ -16,6 +19,13 @@ module.exports = {
}
on15Update()
client.on("message", (msg) => {
if (msg.author.id != client.user.id) return
setTimeout(() => { client.user.setStatus('online') }, 100)
setTimeout(() => { client.user.setStatus('idle') }, 60000 * 5)
})
}
}