{"File":"/root/Telegram-Bot/index.js","LineNumber":122,"LineContent":" await pool.query(`"} {"File":"/root/Telegram-Bot/index.js","LineNumber":136,"LineContent":" await pool.query(`"} {"File":"/root/Telegram-Bot/index.js","LineNumber":223,"LineContent":" existRes = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":229,"LineContent":" existRes = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":239,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":250,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":263,"LineContent":" const deleteRes = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":366,"LineContent":" const res = await pool.query(query, params);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":399,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":724,"LineContent":" const res = await pool.query('SELECT telegram_id FROM users');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":821,"LineContent":" const res = await pool.query('SELECT thread_id FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":848,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":1004,"LineContent":" const res = await pool.query('SELECT credits, plan_type, plan_expires_at FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1060,"LineContent":" const res = await pool.query('SELECT credits FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1065,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":1085,"LineContent":" const res = await pool.query('UPDATE users SET credits = GREATEST(0, credits - $1) WHERE telegram_id = $2 RETURNING credits', [amount, userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1425,"LineContent":" const res = await pool.query('SELECT telegram_id FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1453,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":1460,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":1793,"LineContent":" const res = await pool.query('SELECT total_referrals, referral_earnings FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1951,"LineContent":" const usersRes = await pool.query('SELECT telegram_id, name, credits, thread_id, plan_type, plan_expires_at, created_at FROM users');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":1954,"LineContent":" const searchesRes = await pool.query('SELECT id, telegram_id, search_type, name, mobile_number, eid, aadhaar_number, pdf_password, created_at FROM searches');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2062,"LineContent":" const usersRes = await pool.query('SELECT * FROM users');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2065,"LineContent":" const searchesRes = await pool.query('SELECT * FROM searches');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2155,"LineContent":" const userRes = await pool.query('SELECT * FROM users WHERE telegram_id = $1', [targetUserId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2159,"LineContent":" const searchRes = await pool.query('SELECT COUNT(*) FROM searches WHERE telegram_id = $1', [targetUserId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2224,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2260,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2277,"LineContent":" console.log(\"Checking admin for:\", userId); const res = await pool.query('SELECT is_admin FROM users WHERE telegram_id = $1', [userId]); console.log(\"DB rows:\", res.rows);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2296,"LineContent":" const res = await pool.query('SELECT is_retailer FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2366,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2411,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2453,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2597,"LineContent":" await pool.query('UPDATE users SET credits = GREATEST(0, credits - $1) WHERE telegram_id = $2', [creditsToGive, userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2616,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2682,"LineContent":" const checkRes = await pool.query('SELECT credits FROM users WHERE telegram_id = $1', [targetUserId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":2691,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":2712,"LineContent":" await pool.query('UPDATE users SET credits = credits + $1 WHERE telegram_id = $2', [creditsToRemove, userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":3023,"LineContent":" const res = await pool.query('SELECT telegram_id FROM users');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":3377,"LineContent":" const res = await pool.query('SELECT telegram_id, name, credits FROM users ORDER BY created_at DESC LIMIT 50');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":3620,"LineContent":" const userRes = await pool.query('SELECT credits FROM users WHERE telegram_id = $1', [userId]);"} {"File":"/root/Telegram-Bot/index.js","LineNumber":3636,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":4257,"LineContent":" const res = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":4301,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":5466,"LineContent":" await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":5494,"LineContent":" const dbRes = await pool.query("} {"File":"/root/Telegram-Bot/index.js","LineNumber":5669,"LineContent":" const res = await pool.query('SELECT telegram_id FROM users');"} {"File":"/root/Telegram-Bot/index.js","LineNumber":5759,"LineContent":" await pool.query("}