From 7c64bafdc43f8b8f3df1f4ffbfc8b4daa212fe7f Mon Sep 17 00:00:00 2001 From: p0we7 Date: Thu, 30 May 2024 16:45:07 +0000 Subject: [PATCH] feat: issue line break and support markdown * The issue in the notice is implemented with line break. * The notification format adopts markdown. --- worker/src/util.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/src/util.ts b/worker/src/util.ts index 8749555..69f3700 100644 --- a/worker/src/util.ts +++ b/worker/src/util.ts @@ -55,12 +55,12 @@ function formatStatusChangeNotification( } else if (timeNow == timeIncidentStart) { return { title: `🔴 ${monitor.name} is currently down.`, - body: `Service is unavailable at ${timeNowFormatted}. Issue: ${reason || 'unspecified'}`, + body: `Service is unavailable at ${timeNowFormatted}.\n**Issue:** ${reason || 'unspecified'}`, } } else { return { title: `🔴 ${monitor.name} is still down.`, - body: `Service is unavailable since ${timeIncidentStartFormatted} (${downtimeDuration} minutes). Issue: ${reason || 'unspecified'}`, + body: `Service is unavailable since ${timeIncidentStartFormatted} (${downtimeDuration} minutes).\n**Issue:** ${reason || 'unspecified'}`, } } } @@ -83,7 +83,7 @@ async function notifyWithApprise( title, body, type: 'warning', - format: 'text' + format: 'markdown' }), })