Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -1397,14 +1397,14 @@ client.on('error', (e) => {
|
|
| 1397 |
|
| 1398 |
console.log("[*] Attempting Discord login...");
|
| 1399 |
|
| 1400 |
-
// Watchdog: If not logged in within
|
| 1401 |
const loginWatchdog = setTimeout(() => {
|
| 1402 |
if (!client.isReady()) {
|
| 1403 |
-
console.log(
|
| 1404 |
networkFix.rotateEndpoint();
|
| 1405 |
process.exit(1);
|
| 1406 |
}
|
| 1407 |
-
},
|
| 1408 |
|
| 1409 |
client.login(TOKEN).then(() => {
|
| 1410 |
clearTimeout(loginWatchdog);
|
|
|
|
| 1397 |
|
| 1398 |
console.log("[*] Attempting Discord login...");
|
| 1399 |
|
| 1400 |
+
// Watchdog: If not logged in within 60 seconds, rotate and restart
|
| 1401 |
const loginWatchdog = setTimeout(() => {
|
| 1402 |
if (!client.isReady()) {
|
| 1403 |
+
console.log(`[!] Login Watchdog: Connection hanging on ${networkFix.getTargetDomain()}. Rotating and restarting...`);
|
| 1404 |
networkFix.rotateEndpoint();
|
| 1405 |
process.exit(1);
|
| 1406 |
}
|
| 1407 |
+
}, 60000);
|
| 1408 |
|
| 1409 |
client.login(TOKEN).then(() => {
|
| 1410 |
clearTimeout(loginWatchdog);
|