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] @@ -2287,13 +2287,14 @@ } db[targetUserId].plan_type = 'unlimited'; db[targetUserId].plan_expires_at = planExpiry.toISOString(); - fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); - } else { - await pool.query( - `INSERT INTO users (telegram_id, name, credits, plan_type, plan_expires_at, created_at, updated_at) - VALUES ($1, 'User', 0, 'unlimited', $2, NOW(), NOW()) - ON CONFLICT (telegram_id) - DO UPDATE SET plan_type = 'unlimited', plan_expires_at = EXCLUDED.plan_expires_at`, + db[targetUserId].plan_started_at = new Date().toISOString(); + fs.writeFileSync('db.json', JSON.stringify(db, null, 2)); + } else { + await pool.query( + `INSERT INTO users (telegram_id, name, credits, plan_type, plan_expires_at, plan_started_at, created_at, updated_at) + VALUES ($1, 'User', 0, 'unlimited', $2, NOW(), NOW(), NOW()) + ON CONFLICT (telegram_id) + DO UPDATE SET plan_type = 'unlimited', plan_expires_at = EXCLUDED.plan_expires_at, plan_started_at = NOW(), updated_at = NOW()`, [targetUserId, planExpiry] ); } [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.