ayushyadav7970824760/goldensellingstore_botPublic · Bot Template
AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.
Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
commands/_onProfilePhoto.js
javascript · 117 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// ✅ Stylized bold-italic labels (matches the menu button text style) +15// emoji IDs reused ONLY from buttons already confirmed working elsewhere16// in the bot (Profile/My Keys/Add Balance/Back icons) — avoids showing17// mismatched/wrong custom emoji.18// =========================================================19 20try {21 var userId = String(user.telegramid);22 var chatId = chat.chatid;23 var adminId = "8477746023";24 25 // 📸 DP file_id nikaalo (agar user ki koi profile photo public hai)26 var dpFileId = null;27 try {28 var res = (typeof content === "object" && content) ? content : JSON.parse(content);29 if (res && res.ok && res.result && res.result.total_count > 0) {30 var sizes = res.result.photos[0];31 dpFileId = sizes[sizes.length - 1].file_id;32 }33 } catch (e) {}34 35 // 💎 Emoji — sirf wahi custom IDs jo already buttons pe confirm-working hain36 var e_profile = "<tg-emoji emoji-id='6102818532393750087'>👤</tg-emoji>";37 var e_id = "<tg-emoji emoji-id='5902002809573740949'>🆔</tg-emoji>";38 var e_money = "<tg-emoji emoji-id='6312263493051489212'>💰</tg-emoji>";39 var e_crown = "<tg-emoji emoji-id='6102856637343600044'>👑</tg-emoji>";40 var e_calendar = "<tg-emoji emoji-id='6266866272848321043'>📅</tg-emoji>";41 var e_key = "<tg-emoji emoji-id='6284816251143331422'>🔑</tg-emoji>";42 var e_invest = "<tg-emoji emoji-id='5330237710655306682'>📊</tg-emoji>";43 var e_back = "<tg-emoji emoji-id='5893163582194978381'>⬅️</tg-emoji>";44 45 var userBalance = (function () {46 var resBal = 0;47 try { resBal = Number(Libs.ResourcesLib.userRes("balance").value()) || 0; } catch (e) {}48 return resBal.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 manualKeysP = Bot.getProperty("manual_key_history_" + userId) || [];69 var totalKeys = (Array.isArray(purchasedKeys) ? purchasedKeys.length : 0) + (Array.isArray(manualKeysP) ? manualKeysP.length : 0);70 var totalInvested = Number(Bot.getProperty("total_spent_by_" + userId) || 0).toFixed(2);71 72 // 🎨 Premium profile layout — stylized bold-italic labels (same font as73 // the main menu buttons: 𝑺𝑯𝑶𝑷 𝑵𝑶𝑾 style).74 var caption =75 "<blockquote>" + e_profile + " <b>𝑼𝑺𝑬𝑹 𝑷𝑹𝑶𝑭𝑰𝑳𝑬</b> " + e_profile + "</blockquote>\n\n" +76 "<blockquote>" +77 e_id + " <b>𝑰𝑫:</b> <code>" + userId + "</code>\n\n" +78 e_crown + " <b>𝑵𝒂𝒎𝒆:</b> " + fullName + "\n\n" +79 roleEmojiHtml + " <b>𝑼𝒔𝒆𝒓𝒏𝒂𝒎𝒆:</b> " + username + "\n\n" +80 e_calendar + " <b>𝑱𝒐𝒊𝒏𝒆𝒅:</b> " + joinedDate +81 "</blockquote>\n" +82 "━━━━━━━━━━━━━━━━━━━━━\n" +83 e_money + " <b>𝑩𝒂𝒍𝒂𝒏𝒄𝒆:</b> ₹" + userBalance + "\n" +84 e_invest + " <b>𝑺𝒑𝒆𝒏𝒕:</b> ₹" + totalInvested + "\n" +85 e_key + " <b>𝑲𝒆𝒚𝒔:</b> " + totalKeys + "\n\n" +86 "<i>" + (dpFileId ? "Profile photo fetched from Telegram. ✅" : "No profile photo set.") + "</i>";87 88 var keyboard = [89 [90 { text: "𝑨𝒍𝒍 𝑯𝒊𝒔𝒕𝒐𝒓𝒚", callback_data: "/mykey", style: "primary" },91 { text: "𝑨𝒅𝒅 𝑩𝒂𝒍𝒂𝒏𝒄𝒆", callback_data: "/addfund", style: "success" }92 ],93 [94 { text: "𝑩𝒂𝒄𝒌", callback_data: "/back", style: "danger" }95 ]96 ];97 98 if (dpFileId) {99 Api.sendPhoto({100 chat_id: chatId,101 photo: dpFileId,102 caption: caption,103 parse_mode: "HTML",104 reply_markup: JSON.stringify({ inline_keyboard: keyboard })105 });106 } else {107 Api.sendMessage({108 chat_id: chatId,109 text: caption,110 parse_mode: "HTML",111 reply_markup: JSON.stringify({ inline_keyboard: keyboard })112 });113 }114 115} catch (err) {116 Bot.sendMessage("⚠️ Profile Error: " + err.message, { parse_mode: "HTML" });117}