Failed to fetch data

Error: [ @Moonlink/Database ]: Failed to fetch data at MoonlinkDatabase.fetch (/home/container/node_modules/moonlink.js/dist/src/@Rest/MoonlinkDatabase.js:94:23) at MoonlinkDatabase.get (/home/container/node_modules/moonlink.js/dist/src/@Rest/MoonlinkDatabase.js:26:14) at new MoonlinkPlayer (/home/container/node_modules/moonlink.js/dist/src/@Moonlink/MoonlinkPlayers.js:68:44) at get (/home/container/node_modules/moonlink.js/dist/src/@Moonlink/MoonlinkManager.js:360:20) at MoonlinkManager.create (/home/container/node_modules/moonlink.js/dist/src/@Moonlink/MoonlinkManager.js:396:24) at Client.<anonymous> (/home/container/src/main.js:3545:53) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
5 Replies
metropolitan-bronze
metropolitan-bronzeOP•17mo ago
why i am getting this @1Lucas1.apk
1Lucas1.apk
1Lucas1.apk•17mo ago
The package is unable to read the json file or something is giving it undefined Did you check in node_module if it is creating the json correctly?
metropolitan-bronze
metropolitan-bronzeOP•17mo ago
yep i just fix it like this
const filepath = `./node_modules/moonlink.js/dist/src/@Rest/database-${client.user.id}.json`
if(fs.existsSync(filepath)) {
fs.readFile(filepath, 'utf8', function (err, data) {
if (err) throw err;
const content = {
"queue": {}
}
fs.writeFile(filepath, JSON.stringify(content), err => { if(err) throw err });
})
}
const filepath = `./node_modules/moonlink.js/dist/src/@Rest/database-${client.user.id}.json`
if(fs.existsSync(filepath)) {
fs.readFile(filepath, 'utf8', function (err, data) {
if (err) throw err;
const content = {
"queue": {}
}
fs.writeFile(filepath, JSON.stringify(content), err => { if(err) throw err });
})
}
1Lucas1.apk
1Lucas1.apk•17mo ago
I can't put ./node_modules I will make a parameter for this As soon as it arrives, I will finish analyzing the filters, and I will correct this database error I'm going to make an options so I can choose the location of the jsons
metropolitan-bronze
metropolitan-bronzeOP•17mo ago
@1Lucas1.apk and there is another problem in stop command if i stop the song and there in queue songs will only clear the queue

Did you find this page helpful?