Fix presence updating without restarting bot
Use a discord collection instead of reading from a config file
This commit is contained in:
parent
32862a825f
commit
d91b2c748c
4 changed files with 13 additions and 7 deletions
|
@ -1,10 +1,12 @@
|
|||
const fs = require('fs');
|
||||
module.exports = function (presenceType, presenceText){
|
||||
module.exports = function (presenceType, presenceText, client){
|
||||
const configPath = "./data/config.json";
|
||||
let config = JSON.parse(fs.readFileSync(configPath));
|
||||
|
||||
config.presenceType = presenceType;
|
||||
config.presenceText = presenceText;
|
||||
client.settings.set("presenceType", presenceType);
|
||||
client.settings.set("presenceText", presenceText);
|
||||
|
||||
fs.writeFileSync(configPath, JSON.stringify(config, null, 4));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue