From 727acb32bf8423a5c56cf64776ce33eded9e5aa7 Mon Sep 17 00:00:00 2001 From: Brayan Lozano Date: Tue, 7 Feb 2023 21:18:26 -0500 Subject: [PATCH 1/2] Adds name + status + message to slack notification --- server/notification-providers/slack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index 5a5d40cb..64a58738 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -42,7 +42,7 @@ class Slack extends NotificationProvider { const time = heartbeatJSON["time"]; const textMsg = "Uptime Kuma Alert"; let data = { - "text": monitorJSON ? textMsg + `: ${monitorJSON.name}` : textMsg, + "text": monitorJSON ? `${textMsg}\n${msg}` : textMsg, "channel": notification.slackchannel, "username": notification.slackusername, "icon_emoji": notification.slackiconemo, From d45aee450d3e01a9ee7a4a784ff99268e05fff76 Mon Sep 17 00:00:00 2001 From: Brayan Lozano Date: Tue, 7 Feb 2023 22:34:10 -0500 Subject: [PATCH 2/2] Removes unecessary ternary operator --- server/notification-providers/slack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index 64a58738..da89f0f7 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -42,7 +42,7 @@ class Slack extends NotificationProvider { const time = heartbeatJSON["time"]; const textMsg = "Uptime Kuma Alert"; let data = { - "text": monitorJSON ? `${textMsg}\n${msg}` : textMsg, + "text": `${textMsg}\n${msg}`, "channel": notification.slackchannel, "username": notification.slackusername, "icon_emoji": notification.slackiconemo,