From 8b82520d3d5df23938dfb7ee9696a32b26506b51 Mon Sep 17 00:00:00 2001 From: Dj Isaac Date: Wed, 9 Oct 2024 20:35:26 -0500 Subject: [PATCH] Conditionally add service url --- server/notification-providers/discord.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index 6bacbd0fe..bd54cc7c6 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -33,11 +33,17 @@ class Discord extends NotificationProvider { return okMsg; } + const address = this.extractAddress(monitorJSON); + const embedFields = [ { name: "Service Name", value: monitorJSON["name"], }, + ...((address !== "" && address !== monitorJSON["hostname"]) ? [{ + name: "Service URL", + value: address + }] : []), { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"],