mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
Add serverchan3 support for serverchan notification provider (#5145)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
46d90a6a99
commit
0071775525
1 changed files with 6 additions and 1 deletions
|
@ -11,8 +11,13 @@ class ServerChan extends NotificationProvider {
|
||||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
const okMsg = "Sent Successfully.";
|
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 {
|
try {
|
||||||
await axios.post(`https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`, {
|
await axios.post(url, {
|
||||||
"title": this.checkStatus(heartbeatJSON, monitorJSON),
|
"title": this.checkStatus(heartbeatJSON, monitorJSON),
|
||||||
"desp": msg,
|
"desp": msg,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue