added Gotify Support

This commit is contained in:
Philipp Dormann
2021-07-14 11:25:10 +02:00
parent 3b52433202
commit 126f00e739
2 changed files with 31 additions and 0 deletions

View File

@@ -19,6 +19,22 @@ class Notification {
return false;
}
} else if (notification.type === "gotify") {
try {
if (notification.gotifyserverurl.endsWith("/")) {
notification.gotifyserverurl = notification.gotifyserverurl.slice(0, -1);
}
await axios.post(`${notification.gotifyserverurl}/message?token=${notification.gotifyapplicationToken}`, {
"message": msg,
"priority": 8,
"title": "Uptime-Kuma"
})
return true;
} catch (error) {
console.log(error)
return false;
}
} else if (notification.type === "webhook") {
try {