From f2158ba8ae59982ca9389c6824179865201963cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Fri, 3 Sep 2021 01:21:11 +0300 Subject: [PATCH] Updated datastore.js --- src/client/datastore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/datastore.js b/src/client/datastore.js index dafd80a..dbacf73 100644 --- a/src/client/datastore.js +++ b/src/client/datastore.js @@ -80,6 +80,7 @@ module.exports = class { newData.guild = {}; newData.guild.id = id; newData.statistics = {}; + newData.state = {}; this.map.set(id, newData); this.saveEntry(id, newData); } @@ -90,6 +91,10 @@ module.exports = class { updateEntry(guild, newData) { newData.guild.name = guild.name; + + let date = new Date(); + newData.updated = date.toISOString().substring(0, 10) + this.map.set(guild.id, newData); this.saveEntry(guild.id, newData); //this.showEntry(this.getEntry(guild.id)); @@ -110,6 +115,9 @@ module.exports = class { "time": 0, "used": 0 } + }, + "state": { + } } @@ -118,7 +126,7 @@ module.exports = class { saveEntry(file, data) { data = JSON.stringify(data, null, 4); - + fs.writeFile(path.join(path.dirname(__dirname), '../datastore') + "/" + file + ".json", data, 'utf8', function(err) { if (err) { //console.log(err);