diff --git a/index.js b/index.js index f4f3d34..72326a3 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ const cdrPool = mariadb.createPool(config.cdrdb); const json2csv = (obj) => { let csv = ""; for (let key in obj) { - csv += `${key},${obj[key]}\n`; + csv += `${JSON.stringify(obj[key])}\n`; } return csv; } @@ -1335,6 +1335,7 @@ dcClient.on('interactionCreate', async interaction => { // put fields at the top of the csv result.unshift(fields); const csv = json2csv(result); + console.log(JSON.stringify(result)) // debug const buffer = Buffer.from(csv, 'utf-8'); interaction.editReply({ files: [