From cd0a99de96c3b3b2061df987e229d76dae53aaf9 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Thu, 22 Feb 2024 14:01:19 +0100 Subject: [PATCH] inlined `params` --- server/notification-providers/wecom.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/server/notification-providers/wecom.js b/server/notification-providers/wecom.js index 3048af07..25bc91de 100755 --- a/server/notification-providers/wecom.js +++ b/server/notification-providers/wecom.js @@ -36,9 +36,8 @@ class WeCom extends NotificationProvider { * @returns {object} Message */ composeMessage(heartbeatJSON, monitorJSON, msg) { - let params = {}; if (heartbeatJSON != null) { - params = { + return { msgtype: "markdown", markdown: { content: `## [${this.statusToString( @@ -50,15 +49,13 @@ class WeCom extends NotificationProvider { }`, }, }; - } else { - params = { - msgtype: "text", - text: { - content: msg, - }, - }; } - return params; + return { + msgtype: "text", + text: { + content: msg, + }, + }; } /**