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

javascript · 89 lines

Raw
1/**#command2name: /check3answer: 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 order_id = params ? params.trim() : "";19  if (!order_id && request && request.callback_query) {20    order_id = request.callback_query.data.replace("/check", "").replace("check", "").trim().split(" ")[0];21  }22  if (!order_id) {23    var queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;24    if (queryId) Api.answerCallbackQuery({callback_query_id: queryId, text: "❌ Invalid or Missing Order ID!", show_alert: true});25    else Bot.sendMessage("❌ Invalid or Missing Order ID!", {parse_mode:"HTML"});26    return;27  }28 29  try {30    var verifyUserId = user ? user.telegramid : null;31    if (verifyUserId && request && request.message && request.message.message_id) {32      Bot.setProperty("qr_msg_id_" + verifyUserId, request.message.message_id, "string");33      User.setProperty("qr_msg_id_" + verifyUserId, request.message.message_id, "string");34    }35  } catch (e) {}36 37  // 🟢 Zapupi order (ZP...) -> order-status API38  if (String(order_id).indexOf("ZP") === 0) {39    var zapKeyChk = Bot.getProperty("zapupi_key");40    if (!zapKeyChk) { Bot.sendMessage("⚠️ Zapupi gateway configured nahi hai."); return; }41    var zUid = user ? user.telegramid : "";42    HTTP.post({43      url: "https://pay.zapupi.com/api/order-status",44      headers: { "Content-Type": "application/json" },45      body: JSON.stringify({ zap_key: zapKeyChk, order_id: String(order_id) }),46      success: "/zap_result " + zUid + " " + order_id + " 0 manual",47      error:   "/zap_result " + zUid + " " + order_id + " 0 manual"48    });49    try {50      var zQ = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;51      if (zQ) Api.answerCallbackQuery({ callback_query_id: String(zQ), text: "⏳ Checking payment..." });52    } catch (e) {}53    return;54  }55 56  var merchantId = Bot.getProperty("paytm_merchant_id") || "SDfRhW21109811758334";57  var merchantKey = Bot.getProperty("paytm_merchant_key") || "SDfRhW21109811758334";58 59  var famVerifyKey = Bot.getProperty("fampay_merchant_key") || Bot.getProperty("fampay_api_key") || "";60  var isFamOrder = (Bot.getProperty("pay_gw_" + order_id) === "famgateway") || (String(order_id).indexOf("fg_") === 0);61  // ✅ FIX: Paytm creds sirf NON-FamGateway order ke liye zaroori hain. Pehle ye check har order par62  // lagta tha, isliye FamGateway/UPI payment ka "Verify Payment" button (aur reseller upgrade)63  // "Paytm Merchant ID/Key is not configured" bol kar ruk jata tha.64  if (!(isFamOrder && famVerifyKey) && (!merchantId || !merchantKey)) {65    Bot.sendMessage("❌ Paytm Merchant ID/Key is not configured. Please set Paytm Business payment config from Admin Panel.");66    return;67  }68  var verifyUrl;69  if (isFamOrder && famVerifyKey) {70    // ✅ FIX: pehle yahan verify-order.php (Gmail IMAP-dependent, sometimes slow/lagged) use71    // hota tha, jabki auto-verify aur /famtest checkout-status.php (real-time, IMAP-independent)72    // use karte hain. Isliye "Verify" button kabhi-kabhi fail ho jata tha chahe payment actually73    // ho chuki ho — dono jagah same, zyada reliable endpoint use karo.74    verifyUrl = "https://famgateway.in/api/checkout-status.php?api_key=" + encodeURIComponent(famVerifyKey) +75                "&order_id=" + encodeURIComponent(order_id);76  } else {77    verifyUrl = "https://paytm.anujbots.xyz/verify.php?orderid=" + encodeURIComponent(order_id) +78                    "&merchantid=" + encodeURIComponent(merchantId) +79                    "&merchantkey=" + encodeURIComponent(merchantKey) +80                    "&cb=" + new Date().getTime();81  }82  HTTP.get({83    url: verifyUrl,84    headers: isFamOrder ? { "Authorization": "Bearer " + famVerifyKey, "X-Api-Key": famVerifyKey } : undefined,85    success: "/onCheck", error: "/onCheck"86  });87} catch (err) {88  Bot.sendMessage("⚠️ System Error: " + err.message);89}
commands/_check.js · tarunpoonia905/OfcDevShopBot · TeleDevs