The command exited with code 0.
Output:
}
console.log(`[Attempt ${attempt}] Backend Response Status:`, otpResponse.status, otpData);
if (otpResponse.ok && otpData.status === "success") {
if (statusMessageId) ctx.telegram.deleteMessage(ctx.chat.id, statusMessageId).catch(() => { });
if (session.startLoaderId) {
ctx.telegram.deleteMessage(ctx.chat.id, session.startLoaderId).catch(() => { });
session.startLoaderId = null;
}
session.otpTxnId = otpData.otpTxnId || otpData.txnId;
ctx.reply(`📩 OTP Sent Successfully!\n\nPlease enter the 6-digit OTP sent to your registered mobile number:\n\n💡 Send /cancel to cancel this process.`, { parse_mode: 'HTML' });
session.step = session.pdfPhase ? 'WAITING_FOR_PDF_OTP' : 'WAITING_FOR_OTP';
console.timeEnd(tLabel('Total Loop'));
} else {
let errMsg = otpData ? (otpData.message || (otpData.data && otpData.data.data && otpData.data.data.message) || (otpData.data && otpData.data.message)) : null;
if (errMsg && typeof errMsg === 'string' && !errMsg.toLowerCase().includes('captcha')) {
console.log(`[Attempt ${attempt}] Validation error:`, errMsg);
if (statusMessageId) ctx.telegram.deleteMessage(ctx.chat.id, statusMessageId).catch(() => { });
ctx.reply(`⚠️ Error: ${sanitizeError(errMsg)}\n\nPlease check your details and try again.`, { parse_mode: 'HTML' });
delete sessions[ctx.chat.id];
return;
}
console.log(`[Attempt ${attempt}] Backend returned non-success status or HTTP error. Retrying...`);