From b16aa9c83286a4713aeb69a1e54c7f3687034df1 Mon Sep 17 00:00:00 2001 From: DanielDerefaka Date: Thu, 1 Jan 2026 11:07:16 +0100 Subject: [PATCH] fix(discord): hide empty Service URL and N/A Ping fields - Only show Service URL field when extractAddress returns a non-empty value - Only show Ping field when ping value is not null - This fixes unnecessary 'https://' and 'N/A' values showing for groups Fixes #3327 Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=101010297 --- 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 98e97b85f..155281cdc 100644 --- a/server/notification-providers/discord.js +++ b/server/notification-providers/discord.js @@ -58,7 +58,7 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - ...(!notification.disableUrl ? [{ + ...((!notification.disableUrl && this.extractAddress(monitorJSON)) ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: this.extractAddress(monitorJSON), }] : []), @@ -98,7 +98,7 @@ class Discord extends NotificationProvider { name: "Service Name", value: monitorJSON["name"], }, - ...(!notification.disableUrl ? [{ + ...((!notification.disableUrl && this.extractAddress(monitorJSON)) ? [{ name: monitorJSON["type"] === "push" ? "Service Type" : "Service URL", value: this.extractAddress(monitorJSON), }] : []), @@ -106,10 +106,10 @@ class Discord extends NotificationProvider { name: `Time (${heartbeatJSON["timezone"]})`, value: heartbeatJSON["localDateTime"], }, - { + ...(heartbeatJSON["ping"] != null ? [{ name: "Ping", - value: heartbeatJSON["ping"] == null ? "N/A" : heartbeatJSON["ping"] + " ms", - }, + value: heartbeatJSON["ping"] + " ms", + }] : []), ], }], };