From b1d8f88e9725d520061913ba07d8c4d199f74afd Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 11 Jun 2024 15:21:30 -0600 Subject: [PATCH] Test --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: [