Save presence to config file
This commit is contained in:
parent
5ecd11ffb7
commit
edbf942051
2 changed files with 16 additions and 0 deletions
14
util/savePresence.js
Normal file
14
util/savePresence.js
Normal 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));
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue