If you only need to read the config.json file once, you can use const config = require('./config.json')
, assuming you have the .js file in the same folder as config.json.
If you need to read config.json you can use node's built in module fs
by putting const fs = require('fs')
at the top of your program and using let config = JSON.parse(fs.readFileSync('./config.json'))
to read the file, and using fs.writeFileSync('./config.json', JSON.stringify(config))
to write the file.
You can structure your json file like:
[
{
"accountName": "Pogo0303PTA",
"userId": "<@679533427925450852>"
},
{
"accountName": "Wretched0671pta",
"userId": "<@679533427925450852>"
},
etc...
]
Hope this helped!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…