feat: Add monitor name to notification titles

This commit is contained in:
Tudor Gradinaru committed 2025-10-23 15:32:29 +03:00
1 parent daf5797fed
commit ce025df7b7
2 files changed
+5 -3

No files matched your search

+2 -2
View File
@@ -175,7 +175,7 @@
"checkmate": "Checkmate", "checkmate": "Checkmate",
"url": "URL", "url": "URL",
"unknown": "Unknown", "unknown": "Unknown",
"uptimeAlert": "Uptime Alert: One of your monitors is back online", "uptimeAlert": "Uptime Alert: Your monitor {monitorName} is back online",
"downtimeAlert": "Downtime Alert: One of your monitors went offline" "downtimeAlert": "Downtime Alert: Your monitor {monitorName} went offline"
} }
} }
@@ -74,7 +74,9 @@ class NotificationUtils {
let discordMessageText = { let discordMessageText = {
embeds: [ embeds: [
{ {
title: status ? dn.uptimeAlert : dn.downtimeAlert, title: status
? dn.uptimeAlert.replace("{monitorName}", monitor?.name ?? dn.unknown)
: dn.downtimeAlert.replace("{monitorName}", monitor?.name ?? dn.unknown),
color: status ? 5763719 : 15548997, color: status ? 5763719 : 15548997,
fields: [ fields: [