From 9b16a7d61b0c0b93d034c1ec81bc3d0cb0d3978a Mon Sep 17 00:00:00 2001 From: EpicnessTwo Date: Fri, 6 Oct 2023 17:32:54 +0100 Subject: [PATCH] Fix --- run.js | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/run.js b/run.js index 4579c71..6cc5f67 100644 --- a/run.js +++ b/run.js @@ -95,7 +95,38 @@ function logOutage() { function sendDiscordNotification(start, end) { const durationMinutes = (end - start) / (1000 * 60); return axios.post(DISCORD_WEBHOOK_URL, { - content: `🚫 ${LOCATION} Internet Outage 🚫\nStarted: ${start.toISOString()}\nEnded: ${end.toISOString()}\nDuration: ${durationMinutes.toFixed(2)} minutes` + "content": null, + "embeds": [ + { + "title": `${LOCATION} Internet Outage`, + "color": 16726072, + "fields": [ + { + "name": "Outage Start", + "value": `${start.toISOString()}`, + "inline": true + }, + { + "name": "Outage Ended", + "value": `${end.toISOString()}`, + "inline": true + }, + { + "name": "Duration", + "value": `${durationMinutes.toFixed(2)} minutes` + } + ], + "author": { + "name": "DualPing Alert", + "url": "https://github.com/EpicnessTwo/DualPing" + }, + "footer": { + "text": "Powered by DualPing | https://github.com/EpicnessTwo/DualPing" + } + } + ], + "username": "DualPing Alerts", + "attachments": [] }); }