Check for ping and port type in discord notifs

This commit is contained in:
jordanbertasso 2022-04-10 21:45:07 +10:00
parent ce7d8c38c5
commit 0961c6d9b3

View file

@ -24,14 +24,17 @@ class Discord extends NotificationProvider {
let url; let url;
if (monitorJSON["type"] === "port") { switch (monitorJSON["type"]) {
case "port":
case "ping":
url = monitorJSON["hostname"]; url = monitorJSON["hostname"];
if (monitorJSON["port"]) { if (monitorJSON["port"]) {
url += ":" + monitorJSON["port"]; url += ":" + monitorJSON["port"];
} }
break;
} else { default:
url = monitorJSON["url"]; url = monitorJSON["url"];
break;
} }
// If heartbeatJSON is not null, we go into the normal alerting loop. // If heartbeatJSON is not null, we go into the normal alerting loop.