Slack Enhancements

This commit is contained in:
Niyas 2021-07-17 12:47:52 +05:30 committed by GitHub
parent 78f5d2cd8b
commit 1935da5b16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,13 +128,17 @@ class Notification {
} else if (notification.type === "slack") {
try {
if (heartbeatJSON == null) {
let data = {'text': "Uptime Kuma Slack testing successful."}
let data = {'text': "Uptime Kuma Slack testing successful.", 'channel': notification.slackchannel, 'username': notification.slackusername, 'icon_emoji': notification.slackiconemo}
let res = await axios.post(notification.slackwebhookURL, data)
return true;
}
const time = heartbeatJSON["time"];
let data = {
"text": "Uptime Kuma Alert",
"channel":notification.slackchannel,
"username": notification.slackusername,
"icon_emoji": notification.slackiconemo,
"blocks": [{
"type": "header",
"text": {
@ -164,7 +168,7 @@ class Notification {
"text": "Visit Uptime Kuma",
},
"value": "Uptime-Kuma",
"url": notification.slackbutton
"url": "https://github.com/louislam/uptime-kuma" || notification.slackbutton
}
]
}