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/_removeplan.js

javascript · 95 lines

Raw
1/**#command2name: /removeplan3answer: 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  // Apni Admin Telegram ID yahan dalein19  var adminId = String(Bot.getProperty("owner_id") || "7127818616");20 21  if ((String(chat.chatid) !== adminId && !Bot.getProperty("co_admin_" + String(chat.chatid)))) {22    Bot.sendMessage("❌ You are not the admin!");23    return;24  }25 26  // Format validation verification27  if (!params) {28    Bot.sendMessage("⚠️ Format: `/removeplan PRODUCT NAME | DAYS`\n\n*Example:* `/removeplan FreeFire Hack | 1`", { parse_mode: "Markdown" });29    return;30  }31 32  var data = params.split("|");33  if (data.length < 2) {34    Bot.sendMessage("⚠️ Galat Format! Product Name aur Days '|' se alag honi chahiye.");35    return;36  }37 38  var pName = data[0].trim().toLowerCase();39  var pDays = data[1].trim();40 41  // Database se existing products list nikalna42  var productList = Bot.getProperty("stored_products") || [];43  var productIndex = -1;44 45  // 1. Pehle product find karein46  for (var i = 0; i < productList.length; i++) {47    if (productList[i].name.toLowerCase() === pName) {48      productIndex = i;49      break;50    }51  }52 53  if (productIndex === -1) {54    Bot.sendMessage("❌ Product **" + data[0].trim() + "** database me nahi mila!", { parse_mode: "Markdown" });55    return;56  }57 58  var product = productList[productIndex];59  var plans = product.plans || [];60  var planIndex = -1;61 62  // 2. Us product ke andar targeted plan find karein63  for (var j = 0; j < plans.length; j++) {64    if (String(plans[j].days) === pDays) {65      planIndex = j;66      break;67    }68  }69 70  if (planIndex === -1) {71    Bot.sendMessage("❌ Product me **" + pDays + " Days** wala koi plan nahi mila!", { parse_mode: "Markdown" });72    return;73  }74 75  // 3. Plan ko array se remove (delete) karna76  plans.splice(planIndex, 1);77 78  var feedbackMsg = "";79  80  // 4. Verification Check: Agar saare plans delete ho chuke hain, toh product hi remove kar do81  if (plans.length === 0) {82    productList.splice(productIndex, 1);83    feedbackMsg = "🗑️ Product **" + product.name + "** ka aakhri plan thha, isliye poora product list se remove ho gaya!";84  } else {85    productList[productIndex].plans = plans;86    feedbackMsg = "✅ Product **" + product.name + "** se **" + pDays + " Days** wala plan successfully remove ho gaya!";87  }88 89  // 5. Updated list database me save karna90  Bot.setProperty("stored_products", productList, "json");91  Bot.sendMessage(feedbackMsg, { parse_mode: "Markdown" });92 93} catch (err) {94  Bot.sendMessage("⚠️ Error: " + err.message);95}
commands/_removeplan.js · tarunpoonia905/OfcDevShopBot · TeleDevs