Funny
This commit is contained in:
parent
1431419167
commit
4cf9f775ec
45
index.js
45
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({
|
||||
|
|
Loading…
Reference in a new issue