diff --git a/alertbot.py b/alertbot.py index 3847270..b946e05 100644 --- a/alertbot.py +++ b/alertbot.py @@ -102,7 +102,19 @@ def uptime_kuma_alert_to_markdown(alert_data: dict): def uptime_kuma_resolved_to_markdown(alert_data: dict): - return ["**Uptime Kuma Resolved Data:**\n```\n" + str(alert_data).strip("\n").strip() + "\n```"] + tags_readable = ", ".join([tag["name"] for tag in alert_data["monitor"]["tags"]]) + message = ( + f"""**Resolved 💚**: {alert_data["monitor"]["url"]} + +* **Status:** {alert_data["heartbeat"]["msg"]} +* **Started at:** {alert_data["heartbeat"]["time"]} +* Duration until resolved {alert_data["heartbeat"]["duration"]} +* **Tags:** {tags_readable} +* **Source:** "Uptime Kuma" + """ + ) + return [message] + def grafana_alert_to_markdown(alert_data: dict) -> list: diff --git a/maubot.yaml b/maubot.yaml index d05a196..e9d605a 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.1.0 id: de.hyteck.alertbot -version: 1.0.0 +version: 1.1.0 license: AGPL-3.0-or-later modules: - alertbot