Skip to content

Commit

Permalink
Add serverchan3 support for serverchan notification provider (#5145)
Browse files Browse the repository at this point in the history
Co-authored-by: Frank Elsinga <[email protected]>
  • Loading branch information
easychen and CommanderStorm authored Oct 1, 2024
1 parent 46d90a6 commit 0071775
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/notification-providers/serverchan.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit 0071775

Please sign in to comment.