Add check for status url
This commit is contained in:
parent
ab70230a1a
commit
1431419167
2
index.js
2
index.js
|
@ -749,6 +749,7 @@ dcClient.on('ready', async () => {
|
||||||
})
|
})
|
||||||
}, config.status.interval * 1000);
|
}, config.status.interval * 1000);
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
|
if (config.status?.url) {
|
||||||
axios.get("https://discord.com/api/gateway").then((result) => {
|
axios.get("https://discord.com/api/gateway").then((result) => {
|
||||||
const latency = Date.now() - start;
|
const latency = Date.now() - start;
|
||||||
axios.get(config.status.url + `?status=up&msg=OK&ping=${latency}`).then((result) => {
|
axios.get(config.status.url + `?status=up&msg=OK&ping=${latency}`).then((result) => {
|
||||||
|
@ -757,6 +758,7 @@ dcClient.on('ready', async () => {
|
||||||
sendLog(`${colors.red("[ERROR]")} Error sending ping ${error}`);
|
sendLog(`${colors.red("[ERROR]")} Error sending ping ${error}`);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Start doing SSH stuff
|
// Start doing SSH stuff
|
||||||
sendLog(`${colors.cyan("[INFO]")} Starting SSH connection`);
|
sendLog(`${colors.cyan("[INFO]")} Starting SSH connection`);
|
||||||
|
|
Loading…
Reference in a new issue