Currently my code reads out as
if(message.content.startsWith(prefix + 'readback')) {
fs.readFile('msgs.json', (err, data) => {
if (err) throw err;
let _msgs = JSON.parse(data);
message.channel.send(_msgs);
console.log(_msgs)
});
}
with all appropriate constants and variables
While using prefix + 'readback
, the Discord Bot displays _msgs
as [object Object]
- to make sure it wasn't an issue with the code, I added console.log(_msgs)
, and the correct JSON file content displays in the console. Is there a way to get the Bot to display the contents of the JSON file in a channel?