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] @@ -1121,6 +1121,7 @@ return { hasAccess: true, isUnlimited: true, + isAdmin: true, hasFreeSearch: true, credits: 999999, planExpiresAt: new Date(Date.now() + 1000 * 24 * 60 * 60 * 1000), @@ -1127,4 +1127,7 @@ - createdAt: new Date() + createdAt: new Date(), + subscriptionDuration: 'Lifetime (No Expiry)', + subscriptionPaymentMethod: '👑 Admin VIP Pass', + subscriptionAmount: '₹0 (Master)' }; } @@ -1131,7 +1131,19 @@ const todayStr = getTodayISTDateStr(); const localKey = `${userId}:${todayStr}`; const hasFreeSearch = !dailyFreeSearchesFallback[localKey]; - return { hasAccess: hasFreeSearch, credits: 0, hasFreeSearch, isUnlimited: false, planExpiresAt: null, planStartedAt: null, createdAt: null }; + return { + hasAccess: hasFreeSearch, + credits: 0, + hasFreeSearch, + isUnlimited: false, + isAdmin: false, + planExpiresAt: null, + planStartedAt: null, + createdAt: null, + subscriptionDuration: null, + subscriptionPaymentMethod: null, + subscriptionAmount: null + }; } // Real-time Database Check @@ -1138,4 +1138,4 @@ - const res = await pool.query('SELECT credits, plan_type, plan_expires_at, plan_started_at, created_at, last_free_search_date FROM users WHERE telegram_id = $1', [userId]); + const res = await pool.query('SELECT credits, plan_type, plan_expires_at, plan_started_at, subscription_duration, subscription_payment_method, subscription_amount, created_at, last_free_search_date FROM users WHERE telegram_id = $1', [userId]); let resultData; if (res.rows.length > 0) { const row = res.rows[0]; @@ -1148,6 +1148,7 @@ resultData = { hasAccess: isUnlimited || hasFreeSearch || credits > 0, isUnlimited, + isAdmin: false, hasFreeSearch, credits, planExpiresAt: planExpires, @@ -1154,7 +1154,10 @@ + subscriptionDuration: row.subscription_duration || null, + subscriptionPaymentMethod: row.subscription_payment_method || null, + subscriptionAmount: row.subscription_amount || null, createdAt: row.created_at ? new Date(row.created_at) : null }; } else { - resultData = { hasAccess: false, isUnlimited: false, hasFreeSearch: false, credits: 0, planExpiresAt: null, planStartedAt: null, createdAt: null }; + resultData = { hasAccess: false, isUnlimited: false, isAdmin: false, hasFreeSearch: false, credits: 0, planExpiresAt: null, planStartedAt: null, createdAt: null, subscriptionDuration: null, subscriptionPaymentMethod: null, subscriptionAmount: null }; } return applyFreeMode(resultData); @@ -1161,5 +1161,5 @@ console.error("Error in checkUserAccess:", err.message); - return applyFreeMode({ hasAccess: false, isUnlimited: false, hasFreeSearch: false, credits: 0, planExpiresAt: null, planStartedAt: null, createdAt: null }); + return applyFreeMode({ hasAccess: false, isUnlimited: false, isAdmin: false, hasFreeSearch: false, credits: 0, planExpiresAt: null, planStartedAt: null, createdAt: null, subscriptionDuration: null, subscriptionPaymentMethod: null, subscriptionAmount: null }); } } [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.