FEAT: PUSHY Notifier (#154)

FEAT: PUSHY Notifier (#154)
This commit is contained in:
Philipp Dormann 2021-08-03 17:14:27 +02:00 committed by GitHub
parent 6bd9d85a9a
commit e34a8e2e4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View file

@ -137,6 +137,24 @@ class Notification {
throwGeneralAxiosError(error)
}
} else if (notification.type === "pushy") {
try {
await axios.post(`https://api.pushy.me/push?api_key=${notification.pushyAPIKey}`, {
"to": notification.pushyToken,
"data": {
"message": "Uptime-Kuma"
},
"notification": {
"body": msg,
"badge": 1,
"sound": "ping.aiff"
}
})
return true;
} catch (error) {
console.log(error)
return false;
}
} else if (notification.type === "slack") {
try {
if (heartbeatJSON == null) {