APRK01 commited on
Commit Β·
ff048f3
1
Parent(s): 2482b34
Debug: Increase login timeout and add gateway debug logs
Browse files- src/index.js +8 -2
src/index.js
CHANGED
|
@@ -91,9 +91,15 @@ const token = process.env.BOT_TOKEN;
|
|
| 91 |
console.log(` π Token: ${token ? token.slice(0, 10) + '...' + token.slice(-5) : 'MISSING'}`);
|
| 92 |
console.log(' β³ Connecting to Discord...');
|
| 93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
const loginTimeout = setTimeout(() => {
|
| 95 |
-
console.error('β LOGIN TIMED OUT after
|
| 96 |
-
|
|
|
|
| 97 |
|
| 98 |
client.login(token).then(() => {
|
| 99 |
clearTimeout(loginTimeout);
|
|
|
|
| 91 |
console.log(` π Token: ${token ? token.slice(0, 10) + '...' + token.slice(-5) : 'MISSING'}`);
|
| 92 |
console.log(' β³ Connecting to Discord...');
|
| 93 |
|
| 94 |
+
// Debug logging for Render network issues
|
| 95 |
+
client.on('debug', (info) => {
|
| 96 |
+
if (info.includes('Gateway')) console.log(`[DEBUG] ${info}`);
|
| 97 |
+
});
|
| 98 |
+
|
| 99 |
const loginTimeout = setTimeout(() => {
|
| 100 |
+
console.error('β LOGIN TIMED OUT after 60s β Discord gateway unreachable');
|
| 101 |
+
console.log('π‘ TIP: Render IPs are sometimes flagged by Discord. Try restarting the service or checking the region.');
|
| 102 |
+
}, 60000);
|
| 103 |
|
| 104 |
client.login(token).then(() => {
|
| 105 |
clearTimeout(loginTimeout);
|