Brozy123 commited on
Commit
d5a7d03
·
verified ·
1 Parent(s): 024c3b5

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -24
index.js CHANGED
@@ -1399,36 +1399,14 @@ client.on('error', (e) => {
1399
 
1400
  console.log("[*] Attempting Discord login...");
1401
 
1402
- // Watchdog: If not logged in within 3 minutes, rotate and restart
1403
- let loginWatchdog = setTimeout(() => {
1404
- if (!client.isReady()) {
1405
- console.log(`[!] Login Watchdog: Connection hanging on ${networkFix.getTargetDomain()}. Rotating and restarting...`);
1406
- networkFix.rotateEndpoint();
1407
- process.exit(1);
1408
- }
1409
- }, 180000); // 3 minutes
1410
-
1411
  async function performLogin() {
1412
  try {
1413
- console.log(`[*] Initiating login on endpoint: ${networkFix.getTargetDomain()}...`);
1414
  await client.login(TOKEN);
1415
- clearTimeout(loginWatchdog);
1416
  console.log("[*] client.login() successful.");
1417
  } catch (e) {
1418
  console.error(`[!] Login Failed:`, e.message || e);
1419
- console.log("[*] Retrying login with rotated endpoint...");
1420
-
1421
- networkFix.rotateEndpoint();
1422
-
1423
- // Reset watchdog
1424
- clearTimeout(loginWatchdog);
1425
- loginWatchdog = setTimeout(() => {
1426
- if (!client.isReady()) {
1427
- console.log(`[!] Login Watchdog: Connection hanging. Restarting...`);
1428
- process.exit(1);
1429
- }
1430
- }, 180000); // 3 minutes
1431
-
1432
  setTimeout(performLogin, 10000);
1433
  }
1434
  }
 
1399
 
1400
  console.log("[*] Attempting Discord login...");
1401
 
 
 
 
 
 
 
 
 
 
1402
  async function performLogin() {
1403
  try {
1404
+ console.log(`[*] Initiating login...`);
1405
  await client.login(TOKEN);
 
1406
  console.log("[*] client.login() successful.");
1407
  } catch (e) {
1408
  console.error(`[!] Login Failed:`, e.message || e);
1409
+ console.log("[*] Retrying login in 10s...");
 
 
 
 
 
 
 
 
 
 
 
 
1410
  setTimeout(performLogin, 10000);
1411
  }
1412
  }