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/_press.js

javascript ยท 154 lines

Raw
1/**#command2name: /press3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// Command Name: /press (Premium Calculator Keypad Handler)13// โœ… FIXED: "Back" button pehle "/dmenu" call kar raha tha jo bot me exist hi nahi karta14// (dead button โ€” click karne par kuch nahi hota tha). Ab "/back" (real menu command) use hota hai.15// โœ… Number buttons ab addfund screen jaisi hi blue "primary" styling ke saath hain (pehle plain/colorless the).16 17try {18  // Purana set default check: Agar user ne naya deposit shuru kiya hai toh default 0 rahe19  let current_amount = User.getProperty("deposit_amount");20  if (!current_amount) {21    current_amount = "0";22  }23 24  let pressed = params ? params.trim() : "";25  let queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;26 27  // ๐Ÿ’Ž Premium Emoji Set (same IDs as /addfund โ€” keeps the screen visually identical, no flicker)28  let e_money   = "<tg-emoji emoji-id='6312263493051489212'>๐Ÿ’ฐ</tg-emoji>";29  let e_clear   = "<tg-emoji emoji-id='5348224471050238603'>โœ</tg-emoji>";30  let e_confirm = "<tg-emoji emoji-id='5348191451341668809'>โœ…</tg-emoji>";31  let e_back    = "<tg-emoji emoji-id='5893163582194978381'>โฌ…๏ธ</tg-emoji>";32  let e_hour    = "<tg-emoji emoji-id='6100657257605763582'>โœ”๏ธ</tg-emoji>";33  let e_check   = "<tg-emoji emoji-id='6311870645277825763'>โœ”๏ธ</tg-emoji>";34  let e_gear    = "<tg-emoji emoji-id='5348292765325212780'>โš™</tg-emoji>";35 36  // --- CONFIRM BUTTON CLICK ---37  if (pressed == "confirm") {38    if (parseInt(current_amount) <= 0 || current_amount == "" || current_amount == "0") {39      if (queryId) {40        Api.answerCallbackQuery({41          callback_query_id: queryId,42          text: "๐Ÿ‘€ PLEASE ENTER A VALID AMOUNT!",43          show_alert: true44        });45      }46      return;47    }48 49    let generatingText =50      "<blockquote>" + e_gear + " <b>Generating QR Code for โ‚น" + current_amount + "...</b>\n" +51      "<i>Please wait a moment</i></blockquote>";52 53    Api.editMessageText({54      chat_id: chat.chatid,55      message_id: request.message.message_id,56      text: generatingText,57      parse_mode: "HTML"58    });59 60    // โœ… FIX: is "Generating..." message ka ID save karo taaki QR aane par (ya cancel61    // hone par) ye properly vanish ho sake, stale message ki tarah reh na jaaye.62    try {63      Bot.setProperty("gen_msg_id_" + user.telegramid, request.message.message_id, "string");64      User.setProperty("gen_msg_id_" + user.telegramid, request.message.message_id, "string");65    } catch (e) {}66 67    let finalAmount = String(parseInt(current_amount));68    let upiId = "7796796576@yesfam";69 70    // Amount reset to 0 so next time it starts fresh71    User.setProperty("deposit_amount", "0", "string");72 73    HTTP.get({74      url: "https://fampay.anujbots.xyz/qr.php?upi=" + encodeURIComponent(upiId) + "&amount=" + encodeURIComponent(finalAmount),75      success: "/onQR",76      error: "/onApiError"77    });78 79    return;80  }81 82  // --- KEYPAD INPUT LOGIC ---83  if (pressed == "clear") {84    if (current_amount.length > 1) {85      current_amount = current_amount.slice(0, -1);86    } else {87      current_amount = "0";88    }89  } else if (pressed !== "") {90    if (current_amount == "0") {91      current_amount = pressed;92    } else {93      if ((current_amount + pressed).length <= 6) {94        current_amount = current_amount + pressed;95      }96    }97  }98 99  // Save current keypad amount state100  User.setProperty("deposit_amount", current_amount, "string");101 102  if (queryId) {103    Api.answerCallbackQuery({ callback_query_id: queryId });104  }105 106  // ๐ŸŽจ Keypad Buttons โ€” same premium colored styling as /addfund107  let inlineKeyboardPayload = [108    [109      { text: "1", callback_data: "/press 1", style: "primary" },110      { text: "2", callback_data: "/press 2", style: "primary" },111      { text: "3", callback_data: "/press 3", style: "primary" }112    ],113    [114      { text: "4", callback_data: "/press 4", style: "primary" },115      { text: "5", callback_data: "/press 5", style: "primary" },116      { text: "6", callback_data: "/press 6", style: "primary" }117    ],118    [119      { text: "7", callback_data: "/press 7", style: "primary" },120      { text: "8", callback_data: "/press 8", style: "primary" },121      { text: "9", callback_data: "/press 9", style: "primary" }122    ],123    [124      { text: "Clear", callback_data: "/press clear", style: "danger", icon_custom_emoji_id: "5348224471050238603" },125      { text: "0", callback_data: "/press 0", style: "primary" },126      { text: "Confirm", callback_data: "/press confirm", style: "success", icon_custom_emoji_id: "5348191451341668809" }127    ],128    [129      // โœ… FIXED: "/dmenu" -> "/back" (dead command replaced with the real menu handler)130      { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }131    ]132  ];133 134  let keypadMsg =135    "<blockquote>" + e_money + " <b>ADD BALANCE โ€” ENTER AMOUNT</b> <tg-emoji emoji-id='6312263493051489212'>๐Ÿ’Ž</tg-emoji></blockquote>\n" +136    "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n" +137    "<tg-emoji emoji-id='6312263493051489212'>๐Ÿ’Ž</tg-emoji> <b>Amount:</b> โ‚น<code>" + current_amount + "</code>\n\n" +138    "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n" +139    e_check + " <i>Instant Auto-Credit</i>\n" +140    "<tg-emoji emoji-id='6215386799133433653'>๐Ÿ”’</tg-emoji> <i>100% Secure UPI Payment</i>\n" +141    e_hour + " <i>Verified in Seconds</i>\n\n" +142    "<tg-emoji emoji-id='6100170496077204999'>๐Ÿ‘‘</tg-emoji> <i>Use the keypad below to enter amount</i>";143 144  Api.editMessageText({145    chat_id: chat.chatid,146    message_id: request.message.message_id,147    text: keypadMsg,148    parse_mode: "HTML",149    reply_markup: JSON.stringify({ inline_keyboard: inlineKeyboardPayload })150  });151 152} catch (err) {153  Bot.sendMessage("โš ๏ธ System Error in Keypad: " + err.message);154}