mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-11-09 23:00:18 +00:00
Removed static directory address in datastore.js
This commit is contained in:
parent
f9ba5a3117
commit
9b67506558
@ -9,10 +9,10 @@ module.exports = class {
|
||||
|
||||
loadData() {
|
||||
//console.log("");
|
||||
const dataFiles = fs.readdirSync("D:/GitHub/eximiabots-radiox/datastore"/*path.join(path.dirname(__dirname), 'datastore')*/).filter(f => f.endsWith('.json'));
|
||||
const dataFiles = fs.readdirSync(path.join(path.dirname(__dirname), '../datastore')).filter(f => f.endsWith('.json'));
|
||||
for (const file of dataFiles) {
|
||||
try {
|
||||
const json = require(`../../datastore/${file}`);
|
||||
const json = require(`../../../datastore/${file}`);
|
||||
this.map.set(json.guild.id, json);
|
||||
//console.log('[LOADED] ' + file + " (" + json.guild.id + ")");
|
||||
//console.log(JSON.stringify(json, null, 4));
|
||||
@ -115,7 +115,7 @@ module.exports = class {
|
||||
saveEntry(file, data) {
|
||||
data = JSON.stringify(data, null, 4);
|
||||
|
||||
fs.writeFile(path.join(path.dirname(__dirname), 'datastore') + "/" + file + ".json", data, 'utf8', function(err) {
|
||||
fs.writeFile(path.join(path.dirname(__dirname), '../datastore') + "/" + file + ".json", data, 'utf8', function(err) {
|
||||
if (err) {
|
||||
//console.log(err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user