Spaces:
Runtime error
Runtime error
Update index.js
Browse files
index.js
CHANGED
|
@@ -11,6 +11,8 @@ const { createProfileAttachment } = require('./profileRenderer');
|
|
| 11 |
// Apply network fixes early
|
| 12 |
networkFix.applyAdvancedFixes();
|
| 13 |
|
|
|
|
|
|
|
| 14 |
process.on('unhandledRejection', (reason, promise) => {
|
| 15 |
console.error('[!] Unhandled Rejection:', reason);
|
| 16 |
});
|
|
@@ -1403,14 +1405,14 @@ client.on('error', (e) => {
|
|
| 1403 |
|
| 1404 |
console.log("[*] Attempting Discord login...");
|
| 1405 |
|
| 1406 |
-
// Watchdog: If not logged in within
|
| 1407 |
const loginWatchdog = setTimeout(() => {
|
| 1408 |
if (!client.isReady()) {
|
| 1409 |
console.log(`[!] Login Watchdog: Connection hanging on ${networkFix.getTargetDomain()}. Rotating and restarting...`);
|
| 1410 |
networkFix.rotateEndpoint();
|
| 1411 |
process.exit(1);
|
| 1412 |
}
|
| 1413 |
-
},
|
| 1414 |
|
| 1415 |
client.login(TOKEN).then(() => {
|
| 1416 |
clearTimeout(loginWatchdog);
|
|
|
|
| 11 |
// Apply network fixes early
|
| 12 |
networkFix.applyAdvancedFixes();
|
| 13 |
|
| 14 |
+
console.log(`[SYSTEM] Starting FriendlyBot v4.0 (Watchdog Relaxed: ${new Date().toISOString()})`);
|
| 15 |
+
|
| 16 |
process.on('unhandledRejection', (reason, promise) => {
|
| 17 |
console.error('[!] Unhandled Rejection:', reason);
|
| 18 |
});
|
|
|
|
| 1405 |
|
| 1406 |
console.log("[*] Attempting Discord login...");
|
| 1407 |
|
| 1408 |
+
// Watchdog: If not logged in within 5 minutes, rotate and restart
|
| 1409 |
const loginWatchdog = setTimeout(() => {
|
| 1410 |
if (!client.isReady()) {
|
| 1411 |
console.log(`[!] Login Watchdog: Connection hanging on ${networkFix.getTargetDomain()}. Rotating and restarting...`);
|
| 1412 |
networkFix.rotateEndpoint();
|
| 1413 |
process.exit(1);
|
| 1414 |
}
|
| 1415 |
+
}, 300000);
|
| 1416 |
|
| 1417 |
client.login(TOKEN).then(() => {
|
| 1418 |
clearTimeout(loginWatchdog);
|