From 00717755254b441c6bfb7cecab15e5a741507499 Mon Sep 17 00:00:00 2001 From: Easy Date: Tue, 1 Oct 2024 16:28:47 +0800 Subject: [PATCH] Add serverchan3 support for serverchan notification provider (#5145) Co-authored-by: Frank Elsinga --- server/notification-providers/serverchan.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/notification-providers/serverchan.js b/server/notification-providers/serverchan.js index cefe61f1..ab9308c3 100644 --- a/server/notification-providers/serverchan.js +++ b/server/notification-providers/serverchan.js @@ -11,8 +11,13 @@ class ServerChan extends NotificationProvider { async send(notification, msg, monitorJSON = null, heartbeatJSON = null) { const okMsg = "Sent Successfully."; + // serverchan3 requires sending via ft07.com + const url = String(notification.serverChanSendKey).startsWith("sctp") + ? `https://${notification.serverChanSendKey}.push.ft07.com/send` + : `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`; + try { - await axios.post(`https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`, { + await axios.post(url, { "title": this.checkStatus(heartbeatJSON, monitorJSON), "desp": msg, });