From 6fada9d3fc3221d240035f0011956b41d83d989c Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Sun, 12 May 2024 02:05:26 -0600 Subject: [PATCH] Add heartbeat functionality to Uptime Kuma monitoring --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 2aa2cbb..2bce90d 100644 --- a/index.js +++ b/index.js @@ -433,10 +433,17 @@ xmpp.on("stanza", (stanza) => { xmpp.on("online", async (address) => { if (config["uptime-kuma"].enabled) { + fetch(config["uptime-kuma"].url, { + method: 'POST' + }).then(() => { + console.log(`${colors.cyan("[INFO]")} Sent heartbeat to Uptime Kuma`) + }) setInterval(() => { // Send POST request to config["uptime-kuma"].url fetch(config["uptime-kuma"].url, { method: 'POST' + }).then(() => { + console.log(`${colors.cyan("[INFO]")} Sent heartbeat to Uptime Kuma`) }) }, config["uptime-kuma"].interval * 1000) // Every X seconds }