Merge pull request #3036 from TudorGR/feature/add-monitor-name-to-notification-title

feat: Add monitor name to notification titles
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-10-23 09:38:29 -07:00
commit eb70c9f5f0
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: [