tarunpoonia905/OfcDevShopBotPublic · Bot Template
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
commands/_onDeepLinkPlanShow.js
javascript · 123 lines
1/**#command2name: /onDeepLinkPlanShow3answer: 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 17try {18 var userId = user.telegramid;19 var chatId = User.getProperty("dl_wait_chatid") || chat.chatid;20 var loadingMsgId = User.getProperty("dl_wait_msgid");21 var matchedIdx = Number(User.getProperty("dl_wait_prodidx"));22 23 var productList = Bot.getProperty("stored_products") || [];24 var product = productList[matchedIdx];25 26 if (!product) {27 Bot.sendMessage("⚠️ Product data mismatch, dobara try karein.");28 return;29 }30 31 var isResellerDL = Bot.getProperty("is_reseller_" + userId) === true;32 var planButtons = [];33 var planLines = [];34 var plans = product.plans || [];35 36 if (plans.length === 0) {37 plans = [38 { days: "1", unit: "day", durationDisplay: "1 Day", normal_price: "79", reseller_price: "65" },39 { days: "7", unit: "day", durationDisplay: "7 Days", normal_price: "350", reseller_price: "300" }40 ];41 }42 43 for (var j = 0; j < plans.length; j++) {44 var plan = plans[j];45 var planUnit = plan.unit || "day";46 var cleanProdName = product.name.trim().toUpperCase();47 var cleanPlanDays = String(plan.days).replace(/[^0-9.]/g, "").trim();48 49 var priceKeySuffix = planUnit === "day" ? cleanPlanDays : (cleanPlanDays + "_" + planUnit);50 var normalKey = "price_normal_" + cleanProdName + "_" + priceKeySuffix;51 var resellerKey = "price_reseller_" + cleanProdName + "_" + priceKeySuffix;52 var adminNormalPrice = Bot.getProperty(normalKey);53 var adminResellerPrice = Bot.getProperty(resellerKey);54 var currentNormal = (adminNormalPrice !== undefined && adminNormalPrice !== null) ? adminNormalPrice : plan.normal_price;55 var currentReseller = (adminResellerPrice !== undefined && adminResellerPrice !== null) ? adminResellerPrice : plan.reseller_price;56 var baseDisplayPrice = isResellerDL ? Number(currentReseller) : Number(currentNormal);57 58 var memberPriceKey = "member_custom_price_" + userId + "_" + cleanProdName.replace(/[^A-Z0-9_-]/g, "_") + "_" + (planUnit === "day" ? cleanPlanDays : (cleanPlanDays + "_hour"));59 var memberCustomPrice = Bot.getProperty(memberPriceKey);60 var hasMemberCustomPrice = memberCustomPrice !== undefined && memberCustomPrice !== null && isFinite(Number(memberCustomPrice));61 var displayPrice = hasMemberCustomPrice ? Number(memberCustomPrice) : baseDisplayPrice;62 63 var durationLabel = plan.durationDisplay || (cleanPlanDays + " " + (planUnit === "hour" ? (Number(cleanPlanDays) === 1 ? "Hour" : "Hours") : (planUnit === "minute" ? (Number(cleanPlanDays) === 1 ? "Minute" : "Minutes") : (Number(cleanPlanDays) === 1 ? "Day" : "Days"))));64 var priceEmoji = "<tg-emoji emoji-id='6199422882435571592'>💲</tg-emoji>";65 var durationEmoji = "<tg-emoji emoji-id='5787432469598835099'>⏱️</tg-emoji>";66 planLines.push(priceEmoji + " <b>₹" + Number(displayPrice).toFixed(2) + "</b> — " + durationEmoji + " <b>" + durationLabel.toUpperCase() + "</b>" + (hasMemberCustomPrice ? " 👤" : ""));67 68 planButtons.push([{69 text: durationLabel.toUpperCase() + " — ₹" + Number(displayPrice).toFixed(2),70 callback_data: "/buyitem " + matchedIdx + " " + j,71 style: "success",72 icon_custom_emoji_id: "5787432469598835099"73 }]);74 }75 76 planButtons.push([{77 text: "Back to Products",78 callback_data: "/buy_hack",79 style: "danger",80 icon_custom_emoji_id: "5893163582194978381"81 }]);82 83 var productEmojiId = product.emoji || "6266967801580231067";84 85 var productDLMsg =86 "<blockquote>🛒 <b>" + product.name.toUpperCase() + "</b> 🛒</blockquote>\n\n" +87 "<blockquote><tg-emoji emoji-id='6102685285328362759'>👑</tg-emoji> <b>Your Account Tier: " + (isResellerDL ? "RESELLER" : "USER") + "</b></blockquote>\n\n" +88 "<tg-emoji emoji-id='6188354631454694966'>🛒</tg-emoji> <b>Choose your access plan:</b>\n\n" +89 planLines.join("\n") + "\n\n" +90 "<blockquote><tg-emoji emoji-id='6311831672744580735'>👇</tg-emoji> <i>Tap any plan below to continue</i></blockquote>";91 92 var dlMarkup = JSON.stringify({ inline_keyboard: planButtons });93 94 // Panel Video Demo — video/GIF aur plan text + buttons EK HI message me (alag nahi).95 var dlKey = "product_media_" + String(product.id || product.name || matchedIdx).toUpperCase().replace(/[^A-Z0-9_-]/g, "_");96 var dlMedia = Bot.getProperty(dlKey);97 if (typeof dlMedia === "string") { try { dlMedia = JSON.parse(dlMedia); } catch (eDm) { dlMedia = null; } }98 var dlHasMedia = !!(dlMedia && dlMedia.file_id && (dlMedia.type === "animation" || dlMedia.type === "video"));99 var dlCaption = productDLMsg;100 if (dlHasMedia && dlCaption.replace(/<[^>]*>/g, "").length > 1000) {101 dlCaption = "<blockquote>🛒 <b>" + product.name.toUpperCase() + "</b> 🛒</blockquote>\n\n" + planLines.join("\n");102 if (dlCaption.replace(/<[^>]*>/g, "").length > 1000) { dlHasMedia = false; }103 }104 105 if (dlHasMedia) {106 var dlPayload = { chat_id: String(chatId), caption: dlCaption, parse_mode: "HTML", reply_markup: dlMarkup };107 if (dlMedia.type === "animation") { dlPayload.animation = String(dlMedia.file_id); Api.sendAnimation(dlPayload); }108 else { dlPayload.video = String(dlMedia.file_id); dlPayload.supports_streaming = true; Api.sendVideo(dlPayload); }109 if (loadingMsgId) { try { Api.deleteMessage({ chat_id: String(chatId), message_id: Number(loadingMsgId) }); } catch (eDl) {} }110 } else if (loadingMsgId) {111 Api.editMessageText({ chat_id: String(chatId), message_id: Number(loadingMsgId), text: productDLMsg, parse_mode: "HTML", reply_markup: dlMarkup });112 } else {113 Api.sendMessage({ chat_id: String(chatId), text: productDLMsg, parse_mode: "HTML", reply_markup: dlMarkup });114 }115 116 // cleanup117 User.setProperty("dl_wait_msgid", null, "number");118 User.setProperty("dl_wait_prodidx", null, "number");119 User.setProperty("dl_wait_chatid", null, "string");120 121} catch (err) {122 Bot.sendMessage("⚠️ Delay Callback Error: " + err.message);123}