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/_api_record.js
javascript · 90 lines
1/**#command2name: /api_record3answer: 4keyboard: 5parse_mode: markdown6aliases: /apirecord,/api_record_check7allow_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// Admin-only live connection check for the reseller API (HKMODZ ready).18// URL/keys are never hardcoded: token is saved with /apitoken, other APIs with /apiadd.19try {20 var DEFAULT_URL = "https://hkmodz.shop/api/v1/generate_key.php";21 var ownerId = String(Bot.getProperty("owner_id") || "7127818616");22 var uid = String(chat.chatid);23 var co = Bot.getProperty("co_admin_" + uid);24 if (uid !== ownerId && !co) return;25 26 var reg = Bot.getProperty("api_registry") || {};27 var activeId = String(Bot.getProperty("active_reseller_api") || "");28 var api = activeId ? reg[activeId] : null;29 var token = String(Bot.getProperty("api_secret_token") || "");30 31 // Koi API /apiadd se add nahi hai -> default HKMODZ URL + /apitoken wala token use hoga32 if (!api) {33 activeId = "hkmodz_default";34 api = { name: "HKMODZ", url: DEFAULT_URL, enabled: true };35 }36 if (api.enabled === false) {37 Bot.sendMessage("❌ <b>API Record Check</b>\n\nActive API is disabled: <code>" + activeId + "</code>", {parse_mode:"HTML"});38 return;39 }40 if (!api.url) {41 Bot.sendMessage("❌ <b>API Record Check</b>\n\nAPI URL is missing for <code>" + activeId + "</code>.", {parse_mode:"HTML"});42 return;43 }44 var bearer = token || String(api.api_key || "");45 var isHK = String(api.mode || "").toLowerCase() === "hkmodz" || /hkmodz\.shop\/api\/v1\/generate_key\.php/i.test(String(api.url || ""));46 if (!bearer) {47 Bot.sendMessage(48 "⚠️ <b>API Token set nahi hai!</b>\n\nPehle token save karo:\n<code>/apitoken YOUR_TOKEN</code>\n\nPhir <code>/api_record</code> dubara bhejo.",49 {parse_mode:"HTML"}50 );51 return;52 }53 54 Bot.setProperty("api_record_target_chat", uid, "string");55 Bot.setProperty("api_record_api_id", activeId, "string");56 Bot.setProperty("api_record_started_at", new Date().toISOString(), "string");57 Bot.setProperty("api_record_status", "checking", "string");58 59 var headers = {"Accept":"application/json,text/plain,*/*", "Content-Type":"application/json"};60 if (isHK) { headers = {"Accept":"application/json", "X-API-Token": bearer}; if (api.master_key) headers["X-Master-Key"] = String(api.master_key); }61 else headers["Authorization"] = "Bearer " + bearer;62 if (!isHK) { if (api.api_key) headers["x-api-key"] = String(api.api_key); else headers["x-api-key"] = bearer; }63 if (!isHK && api.master_key) headers["x-master-key"] = String(api.master_key);64 if (api.user_number) headers["x-user-number"] = String(api.user_number);65 if (api.side) headers["x-side"] = String(api.side);66 if (api.policy) headers["x-policy"] = String(api.policy);67 68 Bot.sendMessage(69 "🔎 <b>Live API Record Check Started</b>\n\n" +70 "• API: <b>" + String(api.name || activeId) + "</b>\n" +71 "• URL: <code>" + String(api.url) + "</code>\n" +72 "• Token: <code>" + (bearer.length > 6 ? bearer.substring(0, 3) + "•••" + bearer.slice(-3) : "•••") + "</code>\n" +73 "• User Number: <code>" + String(api.user_number || "Not set") + "</code>\n" +74 "• Side: <code>" + String(api.side || "Not set") + "</code>\n" +75 "• Policy: <code>" + String(api.policy || "Not set") + "</code>\n\n" +76 "⏳ Connecting...",77 {parse_mode:"HTML"}78 );79 80 if (isHK) {81 // HK MODZ: read-only products.php se test — koi key generate nahi hoti, balance nahi katta82 HTTP.get({ url: String(api.url).replace(/generate_key\.php(?:\?.*)?$/i, "products.php"), headers: headers, success: "/api_record_result", error: "/api_record_error" });83 } else if (String(api.url).indexOf("generate_key.php") !== -1) {84 HTTP.post({ url: String(api.url), body: "{}", headers: headers, success: "/api_record_result", error: "/api_record_error" });85 } else {86 HTTP.get({ url: String(api.url), headers: headers, success: "/api_record_result", error: "/api_record_error" });87 }88} catch (e) {89 Bot.sendMessage("⚠️ <b>API Record Error:</b> <code>" + String(e.message || e) + "</code>", {parse_mode:"HTML"});90}