{"File":"/root/aadharbot/index.js","LineNumber":561,"LineContent":" // Capture referral code if present in /start command before blocking"} {"File":"/root/aadharbot/index.js","LineNumber":566,"LineContent":" console.log(`[REFERRAL CAPTURE] Captured pending referral for user ${userId} from referrer ${refCode}`);"} {"File":"/root/aadharbot/index.js","LineNumber":1211,"LineContent":" db[referrerId].total_referrals = (db[referrerId].total_referrals || 0) + 1;"} {"File":"/root/aadharbot/index.js","LineNumber":1212,"LineContent":" db[referrerId].referral_earnings = (db[referrerId].referral_earnings || 0) + 1;"} {"File":"/root/aadharbot/index.js","LineNumber":1225,"LineContent":" `UPDATE users SET credits = credits + 1, total_referrals = COALESCE(total_referrals, 0) + 1, referral_earnings = COALESCE(referral_earnings, 0) + 1 WHERE telegram_id = $1`,"} {"File":"/root/aadharbot/index.js","LineNumber":1233,"LineContent":" bot.telegram.sendMessage(referrerId, `šŸŽ‰ \u003cb\u003eCongratulations!\u003c/b\u003e\\nSomeone joined using your referral link!\\n\\nšŸŽ \u003cb\u003eYou earned 1 Bonus Credit!\u003c/b\u003e ${CREDIT_EMOJI}`, { parse_mode: 'HTML' }).catch(()=\u003e{});"} {"File":"/root/aadharbot/index.js","LineNumber":1527,"LineContent":" totalReferrals = db[userId].total_referrals || 0;"} {"File":"/root/aadharbot/index.js","LineNumber":1528,"LineContent":" totalEarnings = db[userId].referral_earnings || 0;"} {"File":"/root/aadharbot/index.js","LineNumber":1535,"LineContent":" const res = await pool.query('SELECT total_referrals, referral_earnings FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/aadharbot/index.js","LineNumber":1537,"LineContent":" totalReferrals = res.rows[0].total_referrals || 0;"} {"File":"/root/aadharbot/index.js","LineNumber":1538,"LineContent":" totalEarnings = res.rows[0].referral_earnings || 0;"}