diff --git a/index.js b/index.js index 9aa3ea9..ea74c4c 100644 --- a/index.js +++ b/index.js @@ -342,40 +342,6 @@ app.post("/report/:psk", (req, res) => { ], "timestamp": new Date(dataFeilds["UTC Timestamp"]) } - ], - components: [ - { - type: 1, - components: [ - { - type: 2, - style: 1, - label: "Acknowledge", - custom_id: `acknowledge;${row.id}` - }, - { - type: 2, - style: 3, - label: "Close (Action Taken)", - custom_id: `action;${row.id}`, - disabled: true - }, - { - type: 2, - style: 2, - label: "Close (No Action)", - custom_id: `close;${row.id}`, - disabled: true - }, - { - type: 2, - style: 4, - label: "Mark as False Report", - custom_id: `ignore;${row.id}`, - disabled: true - } - ] - } ] } @@ -386,6 +352,41 @@ app.post("/report/:psk", (req, res) => { console.error(`${colors.red("[ERROR]")} ${colors.red(`An error occurred while handling a report: ${err}`)}`); return res.status(500).send({ error: "An error occurred while handling the report" }); } + newMsgData.components = [ + { + type: 1, + components: [ + { + type: 2, + style: 1, + label: "Acknowledge", + custom_id: `acknowledge;${row.id}` + }, + { + type: 2, + style: 3, + label: "Close (Action Taken)", + custom_id: `action;${row.id}`, + disabled: true + }, + { + type: 2, + style: 2, + label: "Close (No Action)", + custom_id: `close;${row.id}`, + disabled: true + }, + { + type: 2, + style: 4, + label: "Mark as False Report", + custom_id: `ignore;${row.id}`, + disabled: true + } + ] + } + ] + msg.edit(msgData); }); }); // Always do this just in case db fails if (err) {