The command exited with code 0.
Output:
// Handle screenshot uploads for payments
bot.on('photo', async (ctx) => {
const userId = ctx.chat.id;
const session = sessions[userId];
if (!session || session.step !== 'WAITING_FOR_SCREENSHOT') return;
const photo = ctx.message.photo;
if (!photo || photo.length === 0) return;
// Get the largest image size
const fileId = photo[photo.length - 1].file_id;
const logGroupId = process.env.LOG_GROUP_ID;
try {
const threadId = await getOrCreateUserThread(ctx, userId, ctx.from.first_name || 'User', ctx.from.username);
if (logGroupId) {
const sendOptions = {
caption: `📊 Payment Proof Submitted / पेमेंट प्रूफ\n` +
`👤 User: ${ctx.from.first_name || 'User'}\n` +
`🆔 ID: ${userId}\n` +
`💵 Expected Amount: ₹${session.expectedAmount}\n` +
`🔢 Submitted UTR: ${session.utr}\n` +
`🧾 Order ID: ${session.orderId}\n` +
`🔢 Serial No: ${session.serialNumber || 'N/A'}`,
parse_mode: 'HTML'
};
if (threadId && threadId !== -1) {
sendOptions.message_thread_id = threadId;
}
// Forward screenshot to the log group
await ctx.telegram.sendPhoto(logGroupId, fileId, sendOptions);
}
// Release/clean up the session step so they can continue bot usage
delete sessions[userId];
const successMsg = `📸 Screenshot Submitted Successfully! / स्क्रीनशॉट सबमिट हो गया!\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`
💰 Status: Verification is in progress. Once confirmed by the gateway, your credits will be updated automatically.\n\n` + `🤖 Note: You can now use other bot features normally.`; await ctx.reply(successMsg, { parse_mode: 'HTML' }); } catch (err) { console.error("[SCREENSHOT FORWARD ERROR]:", err.message); ctx.reply("❌ Submission failed: Could not upload screenshot. Please try again.", { parse_mode: 'HTML' }); } }); const CASHIER_ERROR_MAP = { 504: "Too many requests / operations too frequent (请求太频繁)", 10000: "Insufficient remaining balance error", 10001: "Withdrawal error", 10002: "Deposit error", 11000: "No gateway available for the given amount", 11002: "Deposit amount verification failed or out of range", 11003: "Deposit failed", 11005: "Operations are too frequent. Please wait a few seconds.", 53008: "Daily deposit limit reached", 53009: "Unable to submit, same IP address already used", 53010: "Unable to submit, same device already used" };