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/_onWebKeyError.js
javascript · 81 lines
1/**#command2name: /onWebKeyError3answer: 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 website request failed (timeout / connection error / bad URL).19// ✅ FIX 1: HTTP.post in /confirm_buyitem does not pass `options`, so the old20// code never sent the admin alert (it only ran `if (options)`).21// Now falls back to the last_pending_* properties.22// ✅ FIX 2: the stuck "Processing your order..." message is deleted.23// =========================================================24 25try {26 function escH(s) { return String(s === undefined || s === null ? "" : s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); }27 28 var dataOptions = (typeof options !== "undefined" && options) ? options : {};29 var chatId = dataOptions.chat_id || chat.chatid;30 var userId = dataOptions.user_id || user.telegramid;31 var adminId = String(Bot.getProperty("owner_id") || "7127818616");32 33 var prodName = dataOptions.prod_name || User.getProperty("last_pending_prod_name") || "Unknown";34 var planDays = dataOptions.plan_days || User.getProperty("last_pending_plan_days") || "?";35 var price = Number(dataOptions.price) || Number(User.getProperty("last_pending_price")) || 0;36 var firstName = dataOptions.first_name || user.first_name || "Unknown";37 38 // remove the stuck "Processing..." message39 try {40 var procMsgId = Bot.getProperty("gen_msg_id_" + userId) || User.getProperty("gen_msg_id_" + userId);41 if (procMsgId) {42 Api.deleteMessage({ chat_id: String(chatId), message_id: Number(procMsgId) });43 Bot.setProperty("gen_msg_id_" + userId, null, "string");44 User.setProperty("gen_msg_id_" + userId, null, "string");45 }46 } catch (cleanupErr) {}47 48 var systemErrorText = "<blockquote>" +49 "⏳ <b>KEY ABHI GENERATE NAHI HO PAYI</b>\n" +50 "━━━━━━━━━━━━━━━━━━━━━\n\n" +51 "✅ <b>Aapka paisa 100% safe hai</b> — wallet me jama hai, kuch nahi kata.\n\n" +52 "🔄 Kuch der baad same plan par dobara click karein, key turant mil jayegi.\n" +53 "🛠 Admin ko alert chala gaya hai." +54 "</blockquote>";55 56 Api.sendMessage({57 chat_id: String(chatId),58 text: systemErrorText,59 parse_mode: "HTML",60 reply_markup: JSON.stringify({ inline_keyboard: [[61 { text: "Back to Menu", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }62 ]] })63 });64 65 var raw = "";66 try { raw = (typeof content === "string") ? content : JSON.stringify(content || ""); } catch (eRaw) {}67 68 var adminAlertText = "⚠️ <b>API Reseller Error Alert!</b>\n" +69 "━━━━━━━━━━━━━━━━━━━━━\n" +70 "👤 <b>User:</b> " + escH(firstName) + " (<code>" + userId + "</code>)\n" +71 "📦 <b>Product:</b> <code>" + escH(prodName) + "</code>\n" +72 "⏳ <b>Plan:</b> <code>" + escH(planDays) + " Days</code>\n" +73 "💵 <b>Price Amount:</b> ₹" + price.toFixed(2) + "\n" +74 "🚨 <b>Reason:</b> External Website API is down / timed out / URL galat hai.\n" +75 "🧾 <b>Details:</b> <code>" + escH(String(raw || "no response").slice(0, 300)) + "</code>\n\n" +76 "<i>/extkey_menu → 🧪 Test Connection se URL + key check karo.</i>";77 78 Api.sendMessage({ chat_id: adminId, text: adminAlertText, parse_mode: "HTML" });79} catch (err) {80 try { Bot.sendMessage("⚠️ WebKeyError handler: " + err.message); } catch (e2) {}81}