The command exited with code 0. Output: bot.action(/^BUY_PLAN_(\w+)_(\d+)$/, async (ctx) => { ctx.answerCbQuery().catch(() => { }); const planType = ctx.match[1]; const amount = parseInt(ctx.match[2]); const userId = ctx.from.id; let plans = []; try { const fs = require('fs'); plans = JSON.parse(fs.readFileSync(__dirname + '/plans.json', 'utf8')); } catch(e) { plans = []; } let planLabel = planType.charAt(0).toUpperCase() + planType.slice(1); const matchedPlan = plans.find(p => p.type === planType); if (matchedPlan) planLabel = matchedPlan.label.replace(' šŸ’Ž', ''); console.log(`[PAYMENT] User ${userId} selected ${planLabel} Plan (₹${amount})`); if (amount > 20000) { return ctx.reply(`šŸ’Ž ${planLabel} Plan\n\nFor amounts above ₹20,000, please directly DM our admin @EverythingBypass to arrange the payment and activation.\n\nšŸ‘‰ Click here to contact @EverythingBypass`, { parse_mode: 'HTML', disable_web_page_preview: true }); } try { if (process.env.DATABASE_URL) { const userRes = await pool.query('SELECT credits FROM users WHERE telegram_id = $1', [userId]); if (userRes.rows.length > 0) { const currentCredits = Number(userRes.rows[0].credits || 0); if (currentCredits >= amount) { const planDurations = { 'daily': 24 * 60 * 60 * 1000, 'weekly': 7 * 24 * 60 * 60 * 1000, 'monthly': 30 * 24 * 60 * 60 * 1000, '2months': 60 * 24 * 60 * 60 * 1000, 'yearly': 365 * 24 * 60 * 60 * 1000, 'lifetime': 10 * 365 * 24 * 60 * 60 * 1000 }; const duration = planDurations[planType] || (30 * 24 * 60 * 60 * 1000); const planExpiresAt = new Date(Date.now() + duration); const planExpiryStr = planExpiresAt.toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' }); await pool.query( `UPDATE users SET credits = credits - $1, plan_type = 'unlimited', plan_expires_at = $2, plan_started_at = NOW(), updated_at = NOW() WHERE telegram_id = $3`, [amount, planExpiresAt, userId] ); return ctx.reply(`āœ… Payment Successful! (Paid from Wallet)\n\n` + `šŸ’Ž You have successfully purchased the ${planLabel} Plan for ₹${amount}.\n` + `ā³ Plan Expires: ${planExpiryStr}\n\n` + `Enjoy your unlimited searches!`, { parse_mode: 'HTML' }); } } } } catch (e) { console.error("Wallet deduction error:", e); } const loadMsg = await ctx.reply(`ā³ Generating secure payment QR for ${planLabel} Plan (₹${amount})... Please wait.`, { parse_mode: 'HTML' }); try { await generatePaymentRequest(ctx, userId, amount, planType, loadMsg); } catch (err) { console.error("Plan purchase generation error:", err.message); ctx.reply(`āŒ Failed to generate payment: ${err.message}`, { parse_mode: 'HTML' }); } });