Created At: 2026-11-18T04:42:47Z Completed At: 2026-11-18T04:42:47Z Command exited with code 0. Command output: await autoSolveAndRequestOtp(ctx, session, 1, ldr.message_id); return; } if (session.step === 'WAITING_FOR_OTP') { session.otpValue = text; const oLdr = await ctx.reply('ā³ Verifying OTP... Please wait.', { parse_mode: 'HTML' }); session.otpLoaderId = oLdr.message_id; try { const finalReqBody = { mobile: session.mobile, dob: session.dob, name: session.name, otp: session.otpValue, otpTxnId: session.otpTxnId, captchaValue: session.captchaValue, captchaTxnId: session.transactionId, option: session.serviceType === 'DOWNLOAD_PDF' ? 'EID' : 'UID' }; const finalResponse = await callApi('/verifyotp', { method: 'POST', body: JSON.stringify(finalReqBody) }); const data = await finalResponse.json(); if (finalResponse.ok && data.status === "success") { if (session.otpLoaderId) { ctx.telegram.deleteMessage(userId, session.otpLoaderId).catch(() => { }); } if (session.serviceType === 'RETRIEVE_SMS') { const name = data.data.name; const uidNumber = data.data.uidNumber; const formattedUid = uidNumber ? uidNumber.replace(/(\d{4})(\d{4})(\d{4})/, '$1 $2 $3') : 'N/A'; const access = await checkUserAccess(userId); let leftCredits = access.credits; let chargedDesc = ''; if (access.isUnlimited) { setCooldown(userId, 'RETRIEVE_SMS'); chargedDesc = '0 (VIP Pass)'; } else if (access.hasFreeSearch) { await markDailyFreeSearchUsed(userId); chargedDesc = '0 (Daily Free Search)'; } else { leftCredits = await deductUserCredit(userId, 1); chargedDesc = `1 Credit ${CREDIT_EMOJI}`; } const responseMsg = `šŸ’³ AADHAAR RETRIEVED šŸ’³\n` + `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + `šŸ‘¤ Owner Name: ${name.toUpperCase()}\n` + `šŸ†” Aadhaar No: ${formattedUid}\n` + `šŸ“± Registered: ${session.mobile}\n` + `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + `šŸ’” Full unmasked UID has been sent via official SMS.\n` + `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + `šŸ’° Charged: ${chargedDesc}\n` + `šŸŖ™ Balance: ${access.isUnlimited ? 'Unlimited' : leftCredits + ' Credits'} ${access.isUnlimited ? '' : CREDIT_EMOJI}\n` + `━━━━━━━━━━━━━━━━━━━━━━━━━━\n` + `⚔ AADHAAR VIP ENGINE ⚔`; ctx.reply(responseMsg, { parse_mode: 'HTML' }); await saveSearchRecord(userId, 'RETRIEVE_SMS', name, session.mobile, null, formattedUid, null, null); session.step = 'FINISHED'; } else if (session.serviceType === 'DOWNLOAD_PDF') { session.eidNumber = data.data.eidNumber; session.retrievedName = data.data.name; await saveSearchRecord(userId, 'DOWNLOAD_PDF', session.retrievedName, session.mobile, session.eidNumber, null, null, null); ctx.reply(`šŸŽ‰ Aadhaar Details Located!\n\nšŸ‘¤ Name : ${session.retrievedName}\nšŸ“‘ EID : ${session.eidNumber}\n\nWould you like to securely download the password-free Aadhaar PDF?`, { parse_mode: 'HTML', ...Markup.inlineKeyboard([ [{ text: 'Secure Download PDF', callback_data: 'CONTINUE_PDF', style: 'success' }] ]) }); } } else { if (session.otpLoaderId) { ctx.telegram.deleteMessage(userId, session.otpLoaderId).catch(() => { }); } const failMsg = (data && data.message) ? sanitizeError(data.message) : "Verification failed. Please check the OTP and try again."; ctx.reply(`āŒ ${failMsg}`, { parse_mode: 'HTML' }); session.step = 'FINISHED'; } } catch (error) { console.error(error); ctx.reply('āŒ A temporary error occurred while submitting OTP.', { parse_mode: 'HTML' }); } return; } if (session.step === 'WAITING_FOR_PDF_OTP') { session.otpValue = text; const pLdr = await ctx.reply('ā³ Downloading PDF... Please wait.', { parse_mode: 'HTML' }); session.pdfLoaderId = pLdr.message_id; try { const finalReqBody = { eid: session.eidNumber, otp: session.otpValue, otpTxnId: session.otpTxnId, name: session.retrievedName, dob: session.dob }; const finalResponse = await callApi('/eid-to-adhar/verifyotp', { method: 'POST', body: JSON.stringify(finalReqBody) }); const rawText = await finalResponse.text(); try { const data = JSON.parse(rawText); let rawPdfBuffer = null; if (data.status === "success" && data.pdfBase64) { rawPdfBuffer = Buffer.from(data.pdfBase64, 'base64'); } if (rawPdfBuffer) { let foundPassword = data.pdfPassword || data.pdfPasswordUsed || null; let extractedText = ""; try { const pdfjsLib = require('pdfjs-dist/build/pdf.js'); const doc = await pdfjsLib.getDocument({ data: new Uint8Array(rawPdfBuffer) }).promise;