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.
commands/_addbal.js
javascript · 77 lines
1/**#command2name: /addbal3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12let admin_id = "8660373585"; 13 14if (user.telegramid == admin_id) {15 16 let params = (typeof message !== "undefined" && message) ? message.split(" ") : [];17 let data = params[1]; 18 19 // ✅ FIXED: pehle "Add Bal" admin-panel button dabane par ye seedha "Wrong20 // Format" error de deta tha (kyunki button koi text argument nahi bhejta),21 // aur admin ko turant type karna padta tha "/addbal id|amount" khud se.22 // Ab button dabane par ek proper prompt aata hai aur agla text message23 // auto-capture ho jaata hai (see _start.js "MODULE 5").24 if (!data || !data.includes("|")) {25 User.setProperty("addbal_step", "waiting_input", "string");26 Bot.sendMessage(27 "<tg-emoji emoji-id='5409048419211682843'>💵</tg-emoji> <b>Add Balance</b>\n\n" +28 "<i>User ID aur amount is format me reply karein:</i>\n<code>user_id|amount</code>\n\n" +29 "<i>Example:</i> <code>8154859186|100</code>",30 {parse_mode: "HTML"}31 );32 return;33 }34 35 let splitData = data.split("|");36 let targetUserId = splitData[0].trim();37 let amountToAdd = parseFloat(splitData[1].trim());38 39 if (isNaN(amountToAdd)) {40 Bot.sendMessage("❌ *Invalid Amount!*", {parse_mode: "Markdown"});41 return;42 }43 44 try {45 // Balance add karna46 let targetUserBalance = Libs.ResourcesLib.anotherUserRes("balance", targetUserId);47 targetUserBalance.add(amountToAdd);48 49 // Admin notification50 Bot.sendMessage("✅ Success! Added " + amountToAdd + " to user " + targetUserId);51 52 // All 4 Premium Emojis in Quote Style53 let notificationText = 54 "<blockquote>" +55 "<tg-emoji emoji-id='6192822213486321961'>🗣</tg-emoji> Admin Added: " + amountToAdd + "\n" +56 "<tg-emoji emoji-id='6266967801580231067'>💎</tg-emoji> Balance Credited!\n" +57 "<tg-emoji emoji-id='6267068789146260253'>💰</tg-emoji> Wallet Updated\n" +58 "<tg-emoji emoji-id='5866053971960929280'>🛒</tg-emoji> /start TO SHOP NOW" +59 "</blockquote>";60 61 // Direct Telegram API Method62 HTTP.post({63 url: "https://api.telegram.org/bot" + bot.token + "/sendMessage",64 body: {65 chat_id: targetUserId,66 text: notificationText,67 parse_mode: "HTML"68 }69 });70 71 } catch (err) {72 Bot.sendMessage("⚠️ *Error:* " + err.message, {parse_mode: "Markdown"});73 }74 75} else {76 Bot.sendMessage("❌ You are not authorized to use this command.");77}