tarunpoonia905/OfcDevShopBotPublic · Bot Template

ProfileTelegram

AIDEV SHOP appears to be a Telegram automation bot. Commands include /confirm_delete_stock, /addstock_id, /extkey_menu, /partner_api, /apidelete, /buy_hack_cat, /admin_manage_products, /check_buy. Observed in code: messaging, keyboards, payments, libs, web, http, games.

Utilityutility
228 commands0 envUpdated 12d agoCreated Oct 18, 2026
Back to folder

commands/_setmemberprice.js

javascript · 107 lines

Raw
1/**#command2name: /setmemberprice3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12/*#SIZE_V1*/try{(function(){var z=Bot.getProperty("ui_btn_size");var mx=z==="large"?1:(z==="medium"?2:0);if(!mx||Api.__sz)return;var NAV=/^[◀▶⬅➡«»‹›⏪⏩]|\d+\s*\/\s*\d+|prev|next|page/i;var T=function(m){try{var o=typeof m==="string"?JSON.parse(m):m;if(!o||!o.inline_keyboard)return m;var out=[],cnt=0;o.inline_keyboard.forEach(function(row){var nav=row.some(function(b){return NAV.test(String(b.text||"").trim());});if(row.length<=mx||nav){out.push(row);cnt+=row.length;return;}for(var i=0;i<row.length;i+=mx){var c=row.slice(i,i+mx);out.push(c);cnt+=c.length;}});if(cnt>100||out.length>100)return m;o.inline_keyboard=out;return typeof m==="string"?JSON.stringify(o):o;}catch(e){return m;}};["sendMessage","editMessageText","editMessageCaption","editMessageReplyMarkup","sendPhoto","sendVideo","sendAnimation","sendDocument"].forEach(function(n){var f=Api[n];if(typeof f!=="function")return;Api[n]=function(p){try{if(p&&p.reply_markup)p.reply_markup=T(p.reply_markup);}catch(e){}return f.apply(Api,arguments);};});Api.__sz=true;})();}catch(__szE){}13/*#ANIM_V1*/try{(function(){var M={party:"5046509860389126442",fire:"5104841245755180586",heart:"5159385139981059251",like:"5107584321108051014"};var a=Bot.getProperty("ui_anim");if(!a||!M[a]||Api.__an)return;var E=M[a];var OK=/PURCHASE SUCCESSFUL|PAYMENT SUCCESSFUL|Payment verified|CONGRATULATIONS/i;var priv=function(p){return p&&p.chat_id&&String(p.chat_id).charAt(0)!=="-";};["sendMessage","sendPhoto","sendVideo","sendAnimation"].forEach(function(n){var f=Api[n];if(typeof f!=="function")return;Api[n]=function(p){try{if(priv(p)&&!p.message_effect_id&&OK.test(String(p.text||p.caption||"")))p.message_effect_id=E;}catch(e){}return f.apply(Api,arguments);};});var fe=Api.editMessageText;if(typeof fe==="function"){Api.editMessageText=function(p){var r=fe.apply(Api,arguments);try{if(priv(p)&&OK.test(String(p.text||"")))Api.sendMessage({chat_id:p.chat_id,text:"🎉",message_effect_id:E});}catch(e){}return r;};}Api.__an=true;})();}catch(__anE){}14/*#PREMIUM_UI_V1*/try{(function(){if(Bot.getProperty("ui_premium")!==true||Api.__pm)return;var R=function(t,c){var s=(String(t||"")+" "+String(c||"")).toLowerCase();if(/back|cancel|close|delete|remove|clear|reject|stop|ban|exit/.test(s))return"danger";if(/pay|buy|confirm|verify|paid|add|deposit|shop|claim|yes|receive|wallet|download|update/.test(s))return"success";return"primary";};var T=function(m){try{var o=typeof m==="string"?JSON.parse(m):m;if(!o||!o.inline_keyboard)return m;o.inline_keyboard.forEach(function(row){row.forEach(function(b){if(b.copy_text||b.url||b.callback_data||b.web_app){b.style=R(b.text,b.callback_data||b.url);if(!b.icon_custom_emoji_id&&b.text&&!/^[\u2600-\u27BF\uD83C-\uD83E]/.test(String(b.text).trim())&&!/^[✦✨💎]/.test(b.text))b.text="✦ "+b.text;}});});return typeof m==="string"?JSON.stringify(o):o;}catch(e){return m;}};["sendMessage","editMessageText","editMessageCaption","editMessageReplyMarkup","sendPhoto","sendVideo","sendAnimation","sendDocument"].forEach(function(n){var f=Api[n];if(typeof f!=="function")return;Api[n]=function(p){try{if(p&&p.reply_markup)p.reply_markup=T(p.reply_markup);}catch(e){}return f.apply(Api,arguments);};});Api.__pm=true;})();}catch(__pmE){}15 16 17// 👤 MEMBER-SPECIFIC CUSTOM PRICE18// Usage: /setmemberprice USER_ID | PRODUCT NAME | DURATION | PRICE19// Duration supports: 1h, 2h ... 16h, 1d, 2d, 5d, 11d, etc.20// This does NOT change global normal/reseller prices.21 22try {23  var ownerId = Bot.getProperty("owner_id") || "7127818616";24  var currentChatId = String(chat.chatid);25  var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);26  if ((currentChatId !== String(ownerId) && !Bot.getProperty("co_admin_" + String(currentChatId))) && !isCoAdmin) {27    Bot.sendMessage("❌ Access denied: Admin only.");28    return;29  }30 31  var input = params ? String(params).trim() : "";32  if (!input) {33    Bot.sendMessage(34      "<blockquote>👤 <b>MEMBER CUSTOM PRICE</b></blockquote>\n\n" +35      "<b>Format:</b>\n<code>/setmemberprice USER_ID | PRODUCT NAME | DURATION | PRICE</code>\n\n" +36      "<b>Examples:</b>\n" +37      "<code>/setmemberprice 123456789 | PRIME HOOK | 1h | 50</code>\n" +38      "<code>/setmemberprice 123456789 | PRIME HOOK | 16h | 120</code>\n" +39      "<code>/setmemberprice 123456789 | PRIME HOOK | 1d | 80</code>\n" +40      "<code>/setmemberprice 123456789 | PRIME HOOK | 11d | 400</code>\n\n" +41      "<i>Global price unchanged rahega; custom price sirf is member par lagega.</i>",42      { parse_mode: "HTML" }43    );44    return;45  }46 47  var parts = input.split("|");48  if (parts.length !== 4) {49    Bot.sendMessage("⚠️ 4 fields chahiye: <code>USER_ID | PRODUCT | DURATION | PRICE</code>", { parse_mode: "HTML" });50    return;51  }52 53  var targetId = parts[0].trim();54  var productName = parts[1].trim();55  var duration = parts[2].trim().replace(/\s+/g, " ");56  var customPrice = Number(parts[3].trim());57 58  if (!/^\d+$/.test(targetId)) {59    Bot.sendMessage("❌ USER_ID numeric Telegram ID hona chahiye. Example: <code>123456789</code>", { parse_mode: "HTML" });60    return;61  }62  if (!productName) {63    Bot.sendMessage("❌ Product name empty nahi ho sakta.");64    return;65  }66  if (!duration) {67    Bot.sendMessage("❌ Duration required hai. Example: <code>1h</code>, <code>16h</code>, <code>1d</code>, <code>11d</code>", { parse_mode: "HTML" });68    return;69  }70  if (!isFinite(customPrice) || customPrice < 0) {71    Bot.sendMessage("❌ Valid price enter karein. Price 0 ya usse zyada hona chahiye.");72    return;73  }74 75  // Normalize only the numeric/unit part. Custom API suffixes are not used for this command.76  var m = duration.toLowerCase().match(/^([0-9]+(?:\.[0-9]+)?)\s*(h|hr|hrs|hour|hours|d|day|days)$/);77  if (!m) {78    Bot.sendMessage("❌ Duration format invalid. Use <code>1h</code>, <code>2h</code>, <code>16h</code>, <code>1d</code>, <code>2d</code>, <code>11d</code> etc.", { parse_mode: "HTML" });79    return;80  }81 82  var value = m[1];83  var unit = /^h/.test(m[2]) ? "hour" : "day";84  var suffix = unit === "day" ? value : value + "_hour";85  var cleanProduct = productName.toUpperCase().replace(/\s+/g, " ").trim();86  var keyProduct = cleanProduct.replace(/[^A-Z0-9_-]/g, "_");87  var key = "member_custom_price_" + targetId + "_" + keyProduct + "_" + suffix;88 89  Bot.setProperty(key, customPrice, "number");90 91  var profile = Bot.getProperty("user_profile_" + targetId) || {};92  var displayName = profile.first_name || profile.name || "Member";93  var displayUsername = profile.username ? "@" + String(profile.username).replace(/^@/, "") : "";94 95  Bot.sendMessage(96    "✅ <b>Member price updated</b>\n\n" +97    "👤 <b>Member:</b> " + displayName + (displayUsername ? " (" + displayUsername + ")" : "") + "\n" +98    "🆔 <b>User ID:</b> <code>" + targetId + "</code>\n" +99    "📦 <b>Product:</b> <code>" + cleanProduct + "</code>\n" +100    "⏱️ <b>Duration:</b> <code>" + value + " " + (unit === "hour" ? (Number(value) === 1 ? "Hour" : "Hours") : (Number(value) === 1 ? "Day" : "Days")) + "</code>\n" +101    "💰 <b>Member Price:</b> ₹<code>" + customPrice.toFixed(2) + "</code>\n\n" +102    "ℹ️ Global product price change nahi hua hai. Sirf is member ke liye custom price apply hoga.",103    { parse_mode: "HTML" }104  );105} catch (err) {106  Bot.sendMessage("⚠️ Member price error: <code>" + String(err.message).replace(/</g, "&lt;") + "</code>", { parse_mode: "HTML" });107}
commands/_setmemberprice.js · tarunpoonia905/OfcDevShopBot · TeleDevs