From 4cf9f775ece5a4a12acb0605f595ca7bd9566740 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 18 Jun 2024 21:59:44 -0600 Subject: [PATCH] Funny --- index.js | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/index.js b/index.js index cde9525..4a29eba 100644 --- a/index.js +++ b/index.js @@ -728,28 +728,29 @@ dcClient.on('ready', async () => { }); - // Uptime Kuma Ping - // Calculate ping to Discord API - - // Every X seconds (defined in config.status.interval), send a ping to Uptime Kuma, send push request to config.status.url - setInterval(() => { - // Send a ping to Uptime Kuma - // Send a push request to config.status.url - // Define URL arguments ?status=up&msg=OK&ping= - - // Calculate ping to Discord API - const start = Date.now(); - axios.get("https://discord.com/api/gateway").then((result) => { - const latency = Date.now() - start; - axios.get(config.status.url + `?status=up&msg=OK&ping=${latency}`).then((result) => { - //sendLog(`${colors.cyan("[INFO]")} Sent ping to Uptime Kuma`); - }).catch((error) => { - sendLog(`${colors.red("[ERROR]")} Error sending ping ${error}`); - }); - }) - }, config.status.interval * 1000); - const start = Date.now(); if (config.status?.url) { + // Uptime Kuma Ping + // Calculate ping to Discord API + + // Every X seconds (defined in config.status.interval), send a ping to Uptime Kuma, send push request to config.status.url + setInterval(() => { + // Send a ping to Uptime Kuma + // Send a push request to config.status.url + // Define URL arguments ?status=up&msg=OK&ping= + + // Calculate ping to Discord API + const start = Date.now(); + axios.get("https://discord.com/api/gateway").then((result) => { + const latency = Date.now() - start; + axios.get(config.status.url + `?status=up&msg=OK&ping=${latency}`).then((result) => { + //sendLog(`${colors.cyan("[INFO]")} Sent ping to Uptime Kuma`); + }).catch((error) => { + sendLog(`${colors.red("[ERROR]")} Error sending ping ${error}`); + }); + }) + }, config.status.interval * 1000); + const start = Date.now(); + axios.get("https://discord.com/api/gateway").then((result) => { const latency = Date.now() - start; axios.get(config.status.url + `?status=up&msg=OK&ping=${latency}`).then((result) => { @@ -760,6 +761,8 @@ dcClient.on('ready', async () => { }) } + + // Start doing SSH stuff sendLog(`${colors.cyan("[INFO]")} Starting SSH connection`); await sshConn.connect({