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

javascript · 83 lines

Raw
1/**#command2name: /extkey_menu3answer: 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// =========================================================18// 🔑 EXTERNAL KEY — simple 2-field setup (URL + API Key) for the19// reseller panel that supplies keys for any product/plan that has a20// PID set. This writes into the same api_registry / active_reseller_api21// storage the existing /apiadd + _confirm_buyitem.js purchase flow22// already reads, so nothing about the actual buy logic changes -23// this only makes it easy to set up without typing the full24// /apiadd ID|NAME|URL|... command.25// =========================================================26 27try {28  var ownerId = String(Bot.getProperty("owner_id") || "7127818616");29  var me = String(chat.chatid);30  var isCo = !!Bot.getProperty("co_admin_" + me);31  if (me !== ownerId && !isCo) { Bot.sendMessage("❌ Restricted command!"); return; }32 33  // Cancel / Back / after-save all land here -> drop any stale "waiting for input"34  // flags so a later random message is not accidentally saved as URL / key.35  try { User.setProperty("extkey_url_step", null, "string"); User.setProperty("extkey_apikey_step", null, "string"); User.setProperty("extkey_master_step", null, "string"); } catch (e0) {}36 37  function esc(s) { return String(s === undefined || s === null ? "" : s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); }38  function mask(s) {39    s = String(s || "");40    if (!s) return "Not set";41    if (s.length <= 8) return s.slice(0, 2) + "****";42    return s.slice(0, 6) + "..." + s.slice(-4);43  }44 45  var reg = Bot.getProperty("api_registry") || {};46  var api = reg["default"] || null;47 48  var text =49    "🔑 <b>External Key</b>\n\n" +50    "<i>Ye woh panel hai jahan se PID wale products ki key khareedi jaati hai. " +51    "Jitne bhi products/plans me PID set hoga, sab isi se automatically kharid sakenge.</i>\n\n" +52    "🌐 URL: <code>" + esc(api && api.url ? api.url : "Not set") + "</code>\n" +53    "🔑 API Key: <code>" + esc(mask(api && api.api_key)) + "</code>\n" +54    "🗝 Master Key: <code>" + esc(api && api.master_custom ? mask(api.master_key) : ((api && api.api_key) ? "Same as API key" : "Not set")) + "</code>";55 56  var kb = [57    [{ text: "🌐 Set URL", callback_data: "/extkey_url_btn", style: "primary" }],58    [{ text: "🔑 Set API Key", callback_data: "/extkey_apikey_btn", style: "primary" }],59    [{ text: "🗝 Set Master Key", callback_data: "/extkey_master_btn", style: "primary" }],60    [{ text: "🧪 Test Connection", callback_data: "/extkey_test", style: "success" }],61    [{ text: "🌐 Multi Website (alag product alag API)", callback_data: "/wz go sites", style: "primary" }],62    [{ text: "🔙 Back to Admin", callback_data: "/admin", style: "danger" }]63  ];64 65  var mid = request ? ((request.message && request.message.message_id) ||66    (request.callback_query && request.callback_query.message && request.callback_query.message.message_id)) : null;67  var qid = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;68 69  var forceFresh = (typeof options !== "undefined" && options && options.fresh) ? true : false;70  if (mid && !forceFresh) {71    try {72      Api.editMessageText({ chat_id: me, message_id: Number(mid), text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: kb }) });73    } catch (e) {74      Api.sendMessage({ chat_id: me, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: kb }) });75    }76  } else {77    Api.sendMessage({ chat_id: me, text: text, parse_mode: "HTML", reply_markup: JSON.stringify({ inline_keyboard: kb }) });78  }79  if (qid) { try { Api.answerCallbackQuery({ callback_query_id: String(qid) }); } catch (e) {} }80 81} catch (err) {82  Bot.sendMessage("⚠️ Error: " + err.message);83}
commands/_extkey_menu.js · tarunpoonia905/OfcDevShopBot · TeleDevs