From f6f804ab399a8bde7cb903edfb55b1b4c3d1d13f Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Sun, 9 Jun 2024 10:01:01 +0300 Subject: [PATCH] It actually works now but i want to get it to work properly --- app.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 1b62e10..28aa808 100644 --- a/app.js +++ b/app.js @@ -431,13 +431,9 @@ function writeConfigToFile(filePath) { async function readConfigFromFile(filePath) { await fs.readFile(filePath, 'utf8', (err, data) => { - if(err) return console.log("Error while reading config.json! ", err); - console.log("1:", data); + if(err) return console.log("Error while reading config.json! ", err) data = JSON.parse(data); - console.log("2:", data); - config.userName = data.userName; - config.userAvatar = data.userAvatar; - config.rooms = data.rooms; + config = data; }); }