Spaces:
Runtime error
Runtime error
Update storage.js
Browse files- storage.js +3 -2
storage.js
CHANGED
|
@@ -10,7 +10,7 @@ class Storage {
|
|
| 10 |
settings: path.join(this.dir, 'settings.json'),
|
| 11 |
roles: path.join(this.dir, 'roles.json'),
|
| 12 |
stats: path.join(this.dir, 'stats.json'),
|
| 13 |
-
|
| 14 |
records: path.join(this.dir, 'records.json')
|
| 15 |
};
|
| 16 |
|
|
@@ -40,7 +40,8 @@ class Storage {
|
|
| 40 |
|
| 41 |
save(key) {
|
| 42 |
if (this.files[key]) {
|
| 43 |
-
|
|
|
|
| 44 |
}
|
| 45 |
}
|
| 46 |
|
|
|
|
| 10 |
settings: path.join(this.dir, 'settings.json'),
|
| 11 |
roles: path.join(this.dir, 'roles.json'),
|
| 12 |
stats: path.join(this.dir, 'stats.json'),
|
| 13 |
+
active_polls: path.join(this.dir, 'active_polls.json'),
|
| 14 |
records: path.join(this.dir, 'records.json')
|
| 15 |
};
|
| 16 |
|
|
|
|
| 40 |
|
| 41 |
save(key) {
|
| 42 |
if (this.files[key]) {
|
| 43 |
+
const output = this.data[key] || {};
|
| 44 |
+
fs.writeFileSync(this.files[key], JSON.stringify(output, null, 2));
|
| 45 |
}
|
| 46 |
}
|
| 47 |
|