ashoksarande3/ASHOK_HACK_STORE_BOTPublic · Bot Template

AIThis bot operates as a commercial storefront for selling Free Fire game hacks and cheats via UPI QR code payments. It features a dynamic pricing system with separate normal and reseller prices, product plans with flexible durations (days, hours, minutes), and a reseller program requiring a one-time upgrade fee. The bot handles payment verification through QR code generation and expiry tracking, user verification via Telegram contact sharing, and admin tools for stock management, plan creation, and ownership transfer. It includes a balance system, maintenance mode, and Telegram Stars payment fallback. The codebase uses TeleBotHost's TBL JavaScript APIs (Bot, Api, HTTP, db properties, Libs) for all logic.

Commercefreefiregame-hacksupi-paymentsqr-codesreseller-systemdynamic-pricing
ProfileTelegram
102 commands0 envUpdated 16d agoCreated Aug 22, 2026
Back to folder

commands/_history_receipt.js

javascript · 90 lines

Raw
1/**#command2name: /history_receipt3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🧾 Sends the user's full purchase history as a downloadable .txt file14// =========================================================15 16try {17  var userId = String(user.telegramid);18  var chatId = chat.chatid;19  var userKeys = User.getProperty("my_purchased_keys") || [];20 21  if (userKeys.length === 0) {22    Bot.sendMessage("<blockquote>🧾 <b>No purchase history found!</b>\n<i>Aapne abhi tak kuch bhi buy nahi kiya.</i></blockquote>", { parse_mode: "HTML" });23    return;24  }25 26  var lines = [];27  lines.push("=========================================");28  lines.push("       ASHOK PAINL STORE PANEL — PURCHASE RECEIPT");29  lines.push("=========================================");30  lines.push("User ID     : " + userId);31  lines.push("Name        : " + ((user.first_name || "") + (user.last_name ? " " + user.last_name : "")));32  lines.push("Username    : " + (user.username ? "@" + user.username : "N/A"));33  lines.push("Generated   : " + new Date().toLocaleString());34  lines.push("Total Orders: " + userKeys.length);35  lines.push("=========================================\n");36 37  var totalSpent = 0;38  for (var i = 0; i < userKeys.length; i++) {39    var k = userKeys[i];40    var pName = k.productName || k.product || "N/A";41    var pPrice = Number(k.cost || k.price || 0);42    var pKey = k.key || "N/A";43    var pDays = k.days || "N/A";44    var pDate = k.date || "N/A";45    totalSpent += pPrice;46 47    lines.push("Order #" + (i + 1));48    lines.push("-----------------------------------------");49    lines.push("Product   : " + pName);50    lines.push("Duration  : " + pDays);51    lines.push("Price     : Rs. " + pPrice.toFixed(2));52    lines.push("Key       : " + pKey);53    lines.push("Date      : " + pDate);54    lines.push("");55  }56 57  lines.push("=========================================");58  lines.push("Total Amount Spent: Rs. " + totalSpent.toFixed(2));59  lines.push("=========================================");60  lines.push("Thank you for shopping with ASHOK PAINL STORE PANEL!");61 62  var receiptText = lines.join("\n");63 64  Api.sendDocument({65    chat_id: chatId,66    document: {67      content: receiptText,68      filename: "Receipt_" + userId + ".txt"69    },70    caption: "<blockquote>🧾 <b>YOUR PURCHASE RECEIPT</b></blockquote>\n<i>Poori purchase history is file me hai.</i>",71    parse_mode: "HTML"72  });73 74  Api.sendMessage({75    chat_id: chatId,76    text: "<i>Receipt file bheji gayi hai upar 👆</i>",77    parse_mode: "HTML",78    reply_markup: JSON.stringify({79      inline_keyboard: [[80        { text: "Back to Menu", callback_data: "/back", style: "primary", icon_custom_emoji_id: "5893163582194978381" }81      ]]82    })83  });84 85  var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;86  if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: String(queryId) }); } catch (e) {} }87 88} catch (err) {89  Bot.sendMessage("⚠️ Receipt Error: " + err.message, { parse_mode: "HTML" });90}