From 6476e58907305992694024372c5f7daa4e2dc95b Mon Sep 17 00:00:00 2001 From: Xiaoyu <614422099@QQ.com> Date: Tue, 8 Oct 2024 17:39:22 +0800 Subject: [PATCH] Fix: Resolve notice title definition issue and add newline between title and content in notification (#5166) --- server/notification-providers/wecom.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/notification-providers/wecom.js b/server/notification-providers/wecom.js index 03fa7c186..1eb069095 100644 --- a/server/notification-providers/wecom.js +++ b/server/notification-providers/wecom.js @@ -32,20 +32,17 @@ class WeCom extends NotificationProvider { * @returns {object} Message */ composeMessage(heartbeatJSON, msg) { - let title; + let title = "UptimeKuma Message"; if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === UP) { title = "UptimeKuma Monitor Up"; } if (msg != null && heartbeatJSON != null && heartbeatJSON["status"] === DOWN) { title = "UptimeKuma Monitor Down"; } - if (msg != null) { - title = "UptimeKuma Message"; - } return { msgtype: "text", text: { - content: title + msg + content: title + "\n" + msg } }; }