APRK01 commited on
Commit
ff048f3
Β·
1 Parent(s): 2482b34

Debug: Increase login timeout and add gateway debug logs

Browse files
Files changed (1) hide show
  1. 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 30s β€” Discord gateway unreachable');
96
- }, 30000);
 
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);