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] @@ -2244,11 +2244,11 @@ async function isUserAdmin(userId) { - if (String(userId) === String(process.env.ADMIN_ID || '8439525687')) return true; + if (checkIsAdmin(userId)) return true; if (!process.env.DATABASE_URL) return false; try { - 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); - if (res.rows.length > 0) if(res.rows[0].is_admin) return true; return false; + const res = await pool.query('SELECT is_admin FROM users WHERE telegram_id = $1', [userId]); + if (res.rows.length > 0 && res.rows[0].is_admin) return true; return false; } catch(e) { console.error("Admin check err:", e); return false; } } [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.