mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-08 13:00:35 +08:00
add support for signal notifications
This commit is contained in:
@@ -56,6 +56,22 @@ class Notification {
|
||||
} else if (notification.type === "discord") {
|
||||
return await Notification.discord(notification, msg)
|
||||
|
||||
} else if (notification.type === "signal") {
|
||||
try {
|
||||
let data = {
|
||||
"message": msg,
|
||||
"number": notification.signalNumber,
|
||||
"recipients": notification.signalRecipients.replace(/\s/g, '').split(",")
|
||||
};
|
||||
let config = {};
|
||||
|
||||
let res = await axios.post(notification.signalURL, data, config)
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
throw new Error("Notification type is not supported")
|
||||
}
|
||||
|
Reference in New Issue
Block a user