FileSys.readFile(playlistDir, 'utf-8', (err, data) => { if (err) throw err; if (data.length > 0) { const tempObj = JSON.parse(data); for (const [key] of Object.entries(tempObj)) { exports.playlist[key] = tempObj[key]; } } Object.defineProperty(exports.playlist, '__name', { value: 'playlist', enumerable: false, writable: false, }); Object.defineProperty(exports.playlist, '__path', { value: playlistDir, enumerable: false, writable: false, }); exports.loadedData[exports.playlist] = true; });
FileSys.readFile(mutesDir, 'utf-8', (err, data) => { if (err) throw err; if (data.length > 0) { const tempObj = JSON.parse(data); for (const [key] of Object.entries(tempObj)) { exports.muted[key] = tempObj[key]; } } Object.defineProperty(exports.muted, '__name', { value: 'muted', enumerable: false, writable: false, }); Object.defineProperty(exports.muted, '__path', { value: mutesDir, enumerable: false, writable: false, }); exports.loadedData[exports.muted] = true; Util.log('> Loaded persistent data!'); });
// Deprecated soon FileSys.readFile(autoRoleDir, 'utf-8', (err, data) => { if (err) throw err; if (data.length > 0) { const tempObj = JSON.parse(data); for (const [key] of Object.entries(tempObj)) { exports.autoRoles[key] = tempObj[key]; } } Object.defineProperty(exports.autoRoles, '__name', { value: 'autoRoles', enumerable: false, writable: false, }); Object.defineProperty(exports.autoRoles, '__path', { value: autoRoleDir, enumerable: false, writable: false, }); exports.loadedData[exports.autoRoles] = true; });
FileSys.readFile(histDir, 'utf-8', (err, data) => { if (err) throw err; if (data.length > 0) { const tempObj = JSON.parse(data); for (const [key] of Object.entries(tempObj)) { exports.history[key] = tempObj[key]; } } Object.defineProperty(exports.history, '__name', { value: 'history', enumerable: false, writable: false, }); Object.defineProperty(exports.history, '__path', { value: histDir, enumerable: false, writable: false, }); exports.loadedData[exports.history] = true; });