The following changes were made by the replace_file_content tool to: /root/aadharbot/index.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -1370,18 +1370,18 @@ try { db = JSON.parse(fs.readFileSync('db.json', 'utf8')); } catch (e) { console.error("Error:", e); } } - db[userId] = { name: firstName, credits: 120, plan_type: 'credits', plan_expires_at: null, referred_by: referrerId }; + db[userId] = { name: firstName, credits: 1, plan_type: 'credits', plan_expires_at: null, referred_by: referrerId }; if (referrerId && db[referrerId]) { - db[referrerId].credits = (db[referrerId].credits || 0) + 120; + db[referrerId].credits = (db[referrerId].credits || 0) + 1; db[referrerId].total_referrals = (db[referrerId].total_referrals || 0) + 1; - db[referrerId].referral_earnings = (db[referrerId].referral_earnings || 0) + 120; - } - - fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); - } else { - await pool.query( - `INSERT INTO users (telegram_id, name, credits, plan_type, referred_by, created_at, updated_at) VALUES ($1, $2, 120, 'credits', $3, NOW(), NOW()) + db[referrerId].referral_earnings = (db[referrerId].referral_earnings || 0) + 1; + } + + fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); + } else { + await pool.query( + `INSERT INTO users (telegram_id, name, credits, plan_type, referred_by, created_at, updated_at) VALUES ($1, $2, 1, 'credits', $3, NOW(), NOW()) ON CONFLICT (telegram_id) DO NOTHING`, [userId, firstName, referrerId] ); @@ -1388,6 +1388,6 @@ if (referrerId) { await pool.query( - `UPDATE users SET credits = credits + 120, total_referrals = COALESCE(total_referrals, 0) + 1, referral_earnings = COALESCE(referral_earnings, 0) + 120 WHERE telegram_id = $1`, + `UPDATE users SET credits = credits + 1, total_referrals = COALESCE(total_referrals, 0) + 1, referral_earnings = COALESCE(referral_earnings, 0) + 1 WHERE telegram_id = $1`, [referrerId] ); } @@ -1394,7 +1394,7 @@ - console.log(`[FREE CREDIT] Successfully registered and granted 120 credits to new user: ${userId}`); + console.log(`[FREE CREDIT] Successfully registered and granted 1 credit to new user: ${userId}`); if (referrerId) { - bot.telegram.sendMessage(referrerId, `šŸŽ‰ Congratulations!\nSomeone joined using your referral link!\n\nšŸŽ You earned 120 Bonus Credits!`, { parse_mode: 'HTML' }).catch(()=>{}); + bot.telegram.sendMessage(referrerId, `šŸŽ‰ Congratulations!\nSomeone joined using your referral link!\n\nšŸŽ You earned 1 Bonus Credit!`, { parse_mode: 'HTML' }).catch(()=>{}); } } catch (err) { console.error('[FREE CREDIT] Error registering new user:', err.message); @@ -1403,7 +1403,7 @@ async function showAuthorizedWelcomeMenu(ctx, userId, firstName, isNewUser, access) { const planBadge = access.isUnlimited ? `šŸ‘‘ UNLIMITED VIP šŸ’Ž` - : `₹${access.credits} (Credits) šŸŖ™`; + : `${access.credits} Credits šŸŖ™`; const formatIST = (d) => { if (!d) return null; @@ -1414,7 +1414,8 @@ year: 'numeric', hour: '2-digit', minute: '2-digit', - hour12: true + second: '2-digit', + hour12: false }); } catch (e) { return null; @@ -1421,11 +1421,11 @@ }; let dateLines = ''; - if (access.isUnlimited && access.planExpiresAt) { + if (access.isUnlimited) { const startStr = formatIST(access.planStartedAt) || formatIST(access.createdAt) || 'Active'; - const expiryStr = formatIST(access.planExpiresAt); - dateLines = `🟢 Start Date: ${startStr}\n` + - `šŸ”“ Expiry Date: ${expiryStr}\n`; + const expStr = formatIST(access.planExpiresAt) || 'Lifetime'; + dateLines = `🟢 Start Date: ${startStr}\n` + + `ā³ Expiry Date: ${expStr}\n`; } else { const startStr = formatIST(access.createdAt) || formatIST(new Date()); dateLines = `🟢 Start Date: ${startStr}\n` + @@ -1438,10 +1438,10 @@ `šŸ‘¤ NEW USER PROFILE\n` + `šŸ·ļø Name: ${firstName}\n` + `šŸ†” User ID: ${userId}\n` + - `šŸŽ Bonus: ₹120 Credits Active šŸŖ™\n` + + `šŸŽ Bonus: 1 Free Credit Active šŸŖ™\n` + `${dateLines}` + `šŸŽ‰ FREE TRIAL GRANTED!\n` + - `Aapko 1 Free Search (₹120) mila hai.\n` + + `Aapko 1 Free Search (1 Credit) mila hai.\n` + `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + `šŸ›”ļø Engine: Ultra-Fast v3.0 | Status: Online 🟢\n` + `šŸ’¬ Support: @EverythingBypass\n` + [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown. We did our best to apply changes despite some inaccuracies. Double check if the edit applied is what you intended.