Save presence to config file

This commit is contained in:
SileNce5k 2021-06-27 13:44:10 +02:00
parent 5ecd11ffb7
commit edbf942051
No known key found for this signature in database
GPG key ID: C507260E7F2583AD
2 changed files with 16 additions and 0 deletions

14
util/savePresence.js Normal file
View file

@ -0,0 +1,14 @@
const fs = require('fs');
module.exports = function (presenceType, presenceText){
const configPath = "./data/config.json";
let config = JSON.parse(fs.readFileSync(configPath));
config.presenceType = presenceType;
config.presenceText = presenceText;
console.log(config);
fs.writeFileSync(configPath, JSON.stringify(config, null, 4));
}