Created At: 2026-11-18T04:42:35Z
Completed At: 2026-11-18T04:42:35Z
Command exited with code 0.
Command output:
row.push({ text: `${plans[i+1].label.replace(/[^a-zA-Z0-9 ]/g, '').trim()} (โน${plans[i+1].price.toLocaleString('en-IN')})`, callback_data: `BUY_PLAN_${plans[i+1].type}_${plans[i+1].price}`, style: 'primary' });
}
buttons.push(row);
}
buttons.push([
{ text: '๐ฅ View Today\'s Offers', callback_data: 'SHOW_OFFERS_MENU', style: 'success' },
{ text: 'Back', callback_data: 'BUY_CREDITS_MENU', style: 'danger' }
]);
const buyMsg = `๐ UNLIMITED SEARCH SUBSCRIPTIONS ๐\n` +
`โโโโโโโโโโโโโโโโโโโโโโโโโโ\n` +
`Enjoy unlimited retrievals with zero credit deduction!\n\n` +
`โฑ๏ธ Search Cooldown Limits / เคเฅเค เค
เคเคคเคฐเคพเคฒ เคจเคฟเคฏเคฎ:\n` +
`โข โ๏ธ SMS Retrieve & ๐ EID to PDF: 60 secs cooldown\n` +
`โข ๐ณ No to PDF: 60 secs cooldown\n\n` +
`Select your plan below to generate QR code:\n` +
`โโโโโโโโโโโโโโโโโโโโโโโโโโ`;
ctx.editMessageText(buyMsg, {
parse_mode: 'HTML',
...Markup.inlineKeyboard(buttons)
});
});
// Manual Captcha Fetch
async function fetchManualCaptcha(ctx, session) {
try {
const captchaResponse = await callApi('/captcha', { method: 'GET' });
if (!captchaResponse.ok) {
ctx.reply(`โ *Could not load verification image. Please try again.*`, { parse_mode: 'Markdown' });
return;
}
const data = await captchaResponse.json();
session.transactionId = data.captchaTxnId;
const imageBuffer = Buffer.from(data.captchaBase64, 'base64');
await ctx.replyWithPhoto({ source: imageBuffer }, {
caption: 'โ ๏ธ *Auto-verification paused.*\n\n*Please type the exact characters shown in the image below:*',
parse_mode: 'Markdown'
});
session.step = session.pdfPhase ? 'WAITING_FOR_MANUAL_CAPTCHA_PDF' : 'WAITING_FOR_MANUAL_CAPTCHA';
} catch (error) {
console.error(error);
ctx.reply('โ *A temporary error occurred while fetching verification image.*', { parse_mode: 'Markdown' });
}
}
// Auto-Retry Loop Function
async function autoSolveAndRequestOtp(ctx, session, attempt = 1, statusMessageId = null) {
// 5 invisible tries: allows AI to get a clear captcha without bothering the user
if (attempt > 5) {
if (statusMessageId) ctx.telegram.deleteMessage(ctx.chat.id, statusMessageId).catch(() => { });
await fetchManualCaptcha(ctx, session);
return;
}
const tLabel = (msg) => `[Attempt ${attempt}] ${msg} - ${session.mobile || session.eidNumber}`;
try {
console.time(tLabel('Total Loop'));
console.time(tLabel('Captcha Fetch'));
const captchaResponse = await callApi('/captcha', { method: 'GET', signal: AbortSignal.timeout(10000) });
if (!captchaResponse.ok) throw new Error('Captcha fetch failed');
const data = await captchaResponse.json();
console.timeEnd(tLabel('Captcha Fetch'));
session.transactionId = data.captchaTxnId;
const base64Data = data.captchaBase64;
console.log(`[Attempt ${attempt}] Captcha downloaded, Txn:`, session.transactionId);
console.time(tLabel('OCR Solve'));
const solveRes = await callApi('/solve-captcha', {
method: 'POST',
body: JSON.stringify({ captchaBase64: base64Data }),
signal: AbortSignal.timeout(10000)
});
const solveData = await solveRes.json();
session.captchaValue = solveData.captchaValue;
console.log(`[Attempt ${attempt}] OCR solved:`, session.captchaValue);
console.timeEnd(tLabel('OCR Solve'));
let otpResponse, otpData;
if (session.serviceType === 'RETRIEVE_SMS' || (session.serviceType === 'DOWNLOAD_PDF' && !session.pdfPhase)) {
const reqBody = {
mobile: session.mobile,
name: session.name,
dob: session.dob,
captchaValue: session.captchaValue,
captchaTxnId: session.transactionId,
option: session.serviceType === 'DOWNLOAD_PDF' ? 'EID' : 'UID'
};
console.time(tLabel('Backend Request'));
otpResponse = await callApi('/Retrieve-Aadhaar', {
method: 'POST',
body: JSON.stringify(reqBody),
signal: AbortSignal.timeout(12000)
});
otpData = await otpResponse.json();
console.timeEnd(tLabel('Backend Request'));