From 1431419167f764283eac59e244225a4bd84047f5 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 18 Jun 2024 21:59:06 -0600 Subject: [PATCH] Add check for status url --- index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index d4fcf58..cde9525 100644 --- a/index.js +++ b/index.js @@ -749,14 +749,16 @@ dcClient.on('ready', async () => { }) }, 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) => { - //sendLog(`${colors.cyan("[INFO]")} Sent ping to Uptime Kuma`); - }).catch((error) => { - sendLog(`${colors.red("[ERROR]")} Error sending ping ${error}`); - }); - }) + if (config.status?.url) { + 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}`); + }); + }) + } // Start doing SSH stuff sendLog(`${colors.cyan("[INFO]")} Starting SSH connection`);