From f23baf9c2241284fed55b2b47a88c5efe7970574 Mon Sep 17 00:00:00 2001 From: DasCanard Date: Tue, 24 May 2022 23:14:27 +0200 Subject: [PATCH] Added Push Monitor to Discord Notifications --- server/notification-providers/discord.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/notification-providers/discord.js b/server/notification-providers/discord.js index 77b04d9d3..28ead7b7a 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -55,8 +55,8 @@ class Discord extends NotificationProvider { value: monitorJSON["name"], }, { - name: "Service URL / Address", - value: address, + name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", + value: monitorJSON["type"] === "push" ? "Heartbeat" : address, }, { name: "Time (UTC)", @@ -90,8 +90,8 @@ class Discord extends NotificationProvider { value: monitorJSON["name"], }, { - name: "Service URL", - value: address.startsWith("http") ? "[Visit Service](" + address + ")" : address, + name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", + value: monitorJSON["type"] === "push" ? "Heartbeat" : address.startsWith("http") ? "[Visit Service](" + address + ")" : address, }, { name: "Time (UTC)", @@ -99,7 +99,7 @@ class Discord extends NotificationProvider { }, { name: "Ping", - value: heartbeatJSON["ping"] + "ms", + value: heartbeatJSON["ping"] == null ? "N/A" : heartbeatJSON["ping"] + " ms", }, ], }],