Created At: 2026-11-18T04:51:14Z Completed At: 2026-11-18T04:51:14Z Command exited with code 0. Command output: await startService(ctx, 'RETRIEVE_SMS', mobile); }); bot.action(/^DIRECT_DOWNLOAD_(\d{10})$/, async (ctx) => { const mobile = ctx.match[1]; await startService(ctx, 'DOWNLOAD_PDF', mobile); }); bot.action('EARN_FREE_CREDIT', async (ctx) => { ctx.answerCbQuery().catch(() => {}); const userId = ctx.from.id; let totalReferrals = 0; let totalEarnings = 0; if (!process.env.DATABASE_URL) { const fs = require('fs'); if (fs.existsSync('db.json')) { try { const db = JSON.parse(fs.readFileSync('db.json', 'utf8')); if (db[userId]) { totalReferrals = db[userId].total_referrals || 0; totalEarnings = db[userId].referral_earnings || 0; } } catch (e) { console.error("Error:", e); } } } else { try { const res = await pool.query('SELECT total_referrals, referral_earnings FROM users WHERE telegram_id = $1', [userId]); if (res.rows.length > 0) { totalReferrals = res.rows[0].total_referrals || 0; totalEarnings = res.rows[0].referral_earnings || 0;