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

javascript · 83 lines

Raw
1/**#command2name: /auto_verify_result3answer: 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// ✅ VERIFY RESULT (v8) — verify-order ka reply. Paid + amount-lock OK -> /onCheck (credit, claim-lock, notifications).19// Pending/unknown -> kuch nahi (user "Verify Payment" dabake dobara check kar sakta hai). Koi reschedule nahi.20// verify-order reply (docs): {status:"success", data:{order_id, transaction_id, amount, utr, sender_name, payment_time_ist}}21// =========================================================22try {23  var paramsArr = (typeof params !== "undefined" && params) ? String(params).trim().split(/\s+/) : [];24  var userId  = paramsArr[0] || ((typeof user !== "undefined" && user) ? user.telegramid : null);25  var orderId = paramsArr[1] || null;26  if (!userId || !orderId) return;27  var ownerId = String(Bot.getProperty("owner_id") || "7127818616");28 29  var raw = (typeof content !== "undefined") ? content : null;30  var res = null;31  try { res = (raw && typeof raw === "object") ? raw : JSON.parse(raw); } catch (e) { res = null; }32 33  if (Bot.getProperty("fam_debug") === true) {34    try { Api.sendMessage({ chat_id: ownerId, parse_mode: "HTML", text: "🐞 verify-order " + orderId + "\n<code>" +35      String(typeof raw === "string" ? raw : JSON.stringify(raw || "")).replace(/&/g, "&amp;").replace(/</g, "&lt;").slice(0, 500) + "</code>" }); } catch (e) {}36  }37  if (!res) return;38 39  var d = res.data || {};40  var top = String(res.status || "").toLowerCase();41  var inner = String(d.status || d.payment_status || d.order_status || "").toLowerCase();42  var hasRef = !!(d.utr || d.transaction_id || d.txn_id);43  var paidStates = ["success", "paid", "completed", "captured"];44  var notPaid = (top === "pending" || top === "expired" || inner === "pending" || inner === "expired" || inner === "created" || inner === "failed" || inner === "cancelled");45  var isPaid = (top === "success") && !notPaid && (hasRef || paidStates.indexOf(inner) !== -1 || d.is_paid === true || d.paid === true);46  if (!isPaid) return;47 48  // ---------- Amount lock (order-bound) ----------49  var expectedBase = Number(Bot.getProperty("pay_order_amount_" + orderId) || 0);50  var expectedPayable = Number(Bot.getProperty("pay_order_payable_" + orderId) || 0);51  var paidAmt = parseFloat(d.amount_received || d.paid_amount || d.received_amount || d.payable_amount || d.amount) || 0;52 53  var amountOk;54  if (!(expectedBase > 0)) amountOk = false;55  else if (!(paidAmt > 0)) amountOk = true;                    // gateway ne amount nahi bheja: order-bound success56  else amountOk = Math.abs(paidAmt - expectedBase) <= 0.01 || (expectedPayable > 0 && Math.abs(paidAmt - expectedPayable) <= 0.01);57 58  if (!amountOk) {59    Api.sendMessage({ chat_id: String(userId), parse_mode: "HTML",60      text: "⚠️ <b>Payment mili, lekin amount match nahi hua</b>\n\nExpected: ₹" + (expectedBase > 0 ? expectedBase.toFixed(2) : "?") +61            "\nReceived: ₹" + paidAmt.toFixed(2) + "\n\n<i>Support se contact karo, order ID:</i> <code>" + orderId + "</code>" });62    Api.sendMessage({ chat_id: ownerId, parse_mode: "HTML",63      text: "⚠️ <b>Amount mismatch</b>\nUser: <code>" + userId + "</code>\nOrder: <code>" + orderId + "</code>\nExpected ₹" +64            (expectedBase > 0 ? expectedBase.toFixed(2) : "?") + " / Received ₹" + paidAmt.toFixed(2) + "\nUTR: <code>" + (d.utr || d.transaction_id || "N/A") + "</code>" });65    return;66  }67 68  Bot.run({69    command: "/onCheck",70    options: {71      userId: userId, order_id: orderId, amount: expectedBase,72      is_background: true, auto_verified: true,73      response: { status: "success", data: {74        amount: expectedBase,75        utr: d.utr || d.transaction_id || d.txn_id || orderId,76        sender_name: d.sender_name || d.payer_name || "User",77        payment_time_ist: d.payment_time_ist || d.payment_time || "Now"78      }}79    }80  });81} catch (err) {82  try { Api.sendMessage({ chat_id: String(Bot.getProperty("owner_id") || "7127818616"), text: "⚠️ auto_verify_result error: " + err.message }); } catch (e2) {}83}
commands/_auto_verify_result.js · tarunpoonia905/OfcDevShopBot · TeleDevs