The command exited with code 0. Output: updated = true; } } if (updated) { fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); } } } else { await pool.query( `UPDATE users SET credits = 120 WHERE (plan_type IS NULL OR plan_type = 'credits') AND credits < 120` ); } console.log("[DAILY RESET] Midnight credit reset completed successfully."); // Trigger daily broadcast here! startDailyResetBroadcast(); // Trigger automated daily backup try { console.log("[DAILY BACKUP] Starting scheduled daily backup..."); const { performBackup } = require('./backup_service'); performBackup().catch(backupErr => { console.error("[DAILY BACKUP ERROR] Scheduled backup failed:", backupErr); }); } catch (backupErr) { console.error("[DAILY BACKUP ERROR] Failed to load or start backup service:", backupErr); } } } catch (err) { console.error("[DAILY RESET ERROR] Failed to run daily credit reset:", err.message); } }, 15000); // Check every 15 seconds } async function startBotWithRetry() { try { // Webhook configuration const webhookDomain = process.env.WEBHOOK_DOMAIN; if (webhookDomain) { try { await bot.launch({ webhook: { domain: webhookDomain, hookPath: '/webhook/aadharbot', port: process.env.PORT || 3001, host: '127.0.0.1' } });