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;