diff --git a/commands/work.js b/commands/work.js index 98f0861..12e370b 100644 --- a/commands/work.js +++ b/commands/work.js @@ -59,9 +59,10 @@ module.exports = { if (!success) return client.sendInternalError(interaction, 'Failed to add inventory'); } - const now = new Date(); - const msBetweenDates = Math.abs(inventory.lastWork - now) - const hoursBetweenDates = msBetweenDates / (60 * 60 * 1000) + let now = new Date(); + let diff = (now - inventory.guilds[GuildDB.serverID].lastWork) / 1000; + diff /= (60 * 60); + let hoursBetweenDates = Math.abs(Math.round(diff)); if (hoursBetweenDates >= 24) { let workRoles = [] diff --git a/config/config.js b/config/config.js index 23e4e1e..24d7398 100644 --- a/config/config.js +++ b/config/config.js @@ -2,7 +2,7 @@ require('dotenv').config(); module.exports = { Dev: "PROD.", - Version: "13.1.7", // (major).(feature).(revision/bug/refactoring) + Version: "13.1.8", // (major).(feature).(revision/bug/refactoring) Admins: ["362791661274660874", "329371697570381824"], // Admins of the bot DefaultPrefix: "?", ServerID: "955668596745461830", diff --git a/package.json b/package.json index f723542..bb6d176 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "start": "node index.js", - "dev": "nodemon dev-index.js" + "dev": "node dev-index.js" }, "keywords": [ "Roleplay",