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/_onProfilePhoto.js
javascript ยท 114 lines
1/**#command2name: /onProfilePhoto3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// ๐ค COMMAND = /onProfilePhoto (Premium Profile โ Step 2: final render)14// โ
BUG FIX: reply_markup pehle raw object bhej raha tha (JSON.stringify nahi15// kiya gaya tha) jab DP available thi โ isi wajah se "Back to Menu" button16// kaam nahi kar raha tha / render hi nahi ho raha tha jab DP ke saath bheja jaata.17// =========================================================18 19try {20 var userId = String(user.telegramid);21 var chatId = chat.chatid;22 var adminId = "8660373585";23 24 // ๐ธ DP file_id nikaalo (agar user ki koi profile photo public hai)25 var dpFileId = null;26 try {27 var res = (typeof content === "object" && content) ? content : JSON.parse(content);28 if (res && res.ok && res.result && res.result.total_count > 0) {29 var sizes = res.result.photos[0];30 dpFileId = sizes[sizes.length - 1].file_id;31 }32 } catch (e) {}33 34 // ๐ Premium Emoji Set35 var e_profile = "<tg-emoji emoji-id='6102818532393750087'>๐ค</tg-emoji>";36 var e_id = "<tg-emoji emoji-id='5902002809573740949'>๐</tg-emoji>";37 var e_money = "<tg-emoji emoji-id='6312263493051489212'>๐ฐ</tg-emoji>";38 var e_crown = "<tg-emoji emoji-id='6102856637343600044'>๐</tg-emoji>";39 var e_calendar = "<tg-emoji emoji-id='6266866272848321043'>๐
</tg-emoji>";40 var e_key = "<tg-emoji emoji-id='6284816251143331422'>๐</tg-emoji>";41 var e_invest = "<tg-emoji emoji-id='5330237710655306682'>๐</tg-emoji>";42 var e_back = "<tg-emoji emoji-id='5893163582194978381'>โฌ
๏ธ</tg-emoji>";43 44 var userBalance = (function () {45 var resBal = 0;46 try { resBal = Number(Libs.ResourcesLib.userRes("balance").value()) || 0; } catch (e) {}47 var bonusBal = Number(Bot.getProperty("balance" + userId) || 0);48 return (resBal + bonusBal).toFixed(2);49 })();50 51 var username = user.username ? "@" + user.username : "Not Set";52 var fullName = (user.first_name || "") + (user.last_name ? " " + user.last_name : "");53 54 var role, roleEmojiHtml;55 if (userId === adminId) {56 role = "Admin"; roleEmojiHtml = e_crown;57 } else if (Bot.getProperty("co_admin_" + userId)) {58 role = "Co-Admin"; roleEmojiHtml = e_crown;59 } else {60 var isReseller = Bot.getProperty("is_reseller_" + userId);61 var hasReseller = (isReseller === true || String(isReseller).toLowerCase() === "true");62 role = hasReseller ? "Reseller ๐ฐ" : "Regular User";63 roleEmojiHtml = hasReseller ? "<tg-emoji emoji-id='5346024644635804737'>๐ฐ</tg-emoji>" : "๐";64 }65 66 var joinedDate = Bot.getProperty("joined_date_" + userId) || "N/A";67 var purchasedKeys = User.getProperty("my_purchased_keys") || [];68 var totalKeys = Array.isArray(purchasedKeys) ? purchasedKeys.length : 0;69 var totalInvested = Number(Bot.getProperty("total_spent_by_" + userId) || 0).toFixed(2);70 71 // ๐จ Premium profile layout (matches the reference design)72 var caption =73 "<blockquote>" + e_profile + " <b>USER PROFILE</b> " + e_profile + "</blockquote>\n\n" +74 e_id + " <b>ID:</b> <code>" + userId + "</code>\n" +75 "<b>Name:</b> " + fullName + "\n" +76 "<b>Username:</b> " + username + "\n" +77 e_calendar + " <b>Joined:</b> " + joinedDate + "\n" +78 roleEmojiHtml + " <b>Account Type:</b> " + role + "\n" +79 "โโโโโโโโโโโโโโโโโโโโโ\n\n" +80 e_money + " <b>Balance:</b> โน" + userBalance + "\n" +81 e_invest + " <b>Spent:</b> โน" + totalInvested + "\n" +82 e_key + " <b>Keys:</b> " + totalKeys + "\n\n" +83 "<i>" + (dpFileId ? "Profile photo fetched from Telegram." : "No profile photo set.") + "</i>";84 85 var keyboard = [86 [87 { text: "My Keys", callback_data: "/mykey", style: "primary", icon_custom_emoji_id: "6284816251143331422" },88 { text: "Add Fund", callback_data: "/addfund", style: "success", icon_custom_emoji_id: "6312263493051489212" }89 ],90 [91 { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }92 ]93 ];94 95 if (dpFileId) {96 Api.sendPhoto({97 chat_id: chatId,98 photo: dpFileId,99 caption: caption,100 parse_mode: "HTML",101 reply_markup: JSON.stringify({ inline_keyboard: keyboard })102 });103 } else {104 Api.sendMessage({105 chat_id: chatId,106 text: caption,107 parse_mode: "HTML",108 reply_markup: JSON.stringify({ inline_keyboard: keyboard })109 });110 }111 112} catch (err) {113 Bot.sendMessage("โ ๏ธ Profile Error: " + err.message, { parse_mode: "HTML" });114}