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

javascript · 167 lines

Raw
1/**#command2name: /onContactRecieved3answer: 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 userId = user.telegramid;19  var contactData = request && request.message ? request.message.contact : null;20 21  if (!contactData) {22    Bot.sendMessage("⚠️ Contact data nahi mila, dobara try karein.");23    return;24  }25 26  if (String(contactData.user_id) !== String(userId)) {27    Api.sendMessage({28      chat_id: chat.chatid,29      text: "⚠️ <b>Please share your own contact</b> to verify.",30      parse_mode: "HTML",31      reply_markup: JSON.stringify({32        keyboard: [[{ text: "✅ Verify Account", request_contact: true }]],33        resize_keyboard: true,34        one_time_keyboard: true35      })36    });37    return;38  }39 40  Bot.setProperty("verified_" + userId, true, "boolean");41  User.setProperty("verified_" + userId, true, "boolean");42  // ✅ NEW: Joined date save karo (Profile section me dikhane ke liye)43  if (!Bot.getProperty("joined_date_" + userId)) {44    Bot.setProperty("joined_date_" + userId, new Date().toLocaleDateString("en-IN", { day: "2-digit", month: "short", year: "numeric" }), "string");45  }46 47  var phone = contactData.phone_number || "N/A";48 49  Api.sendMessage({50    chat_id: chat.chatid,51    text: "<blockquote><tg-emoji emoji-id='5330237710655306682'>✅</tg-emoji> <b>Account Verified Successfully!</b>\n<tg-emoji emoji-id='6266994443262367483'>😊</tg-emoji> <i>Welcome! Loading your menu...</i></blockquote>",52    parse_mode: "HTML",53    reply_markup: JSON.stringify({ remove_keyboard: true })54  });55 56  var adminId = String(Bot.getProperty("owner_id") || "7127818616");57  var uName = (user && user.first_name) ? user.first_name : "Unknown";58  var uUsername = (user && user.username) ? "@" + user.username : "No Username";59 60  var adminAlert = "<blockquote>" +61    "<tg-emoji emoji-id='6113743082358841933'>🔰</tg-emoji> <b>NEW USER VERIFIED</b>\n" +62    "━━━━━━━━━━━━━━━━━━━━━━━━━━\n" +63    "👤 <b>Name:</b> " + uName + " (" + uUsername + ")\n" +64    "🆔 <b>User ID:</b> <code>" + userId + "</code>\n" +65    "📞 <b>Phone:</b> <code>" + phone + "</code>\n" +66    "━━━━━━━━━━━━━━━━━━━━━━━━━━\n" +67    "✅ <i>Status: Verified via Contact Share</i>" +68    "</blockquote>";69 70  Api.sendMessage({ chat_id: adminId, text: adminAlert, parse_mode: "HTML" });71 72  // 🔗 PENDING DEEP LINK -> LOADING THEN SHOW PRODUCT PLANS (via HTTP delay)73  var pendingSlug = Bot.getProperty("pending_deeplink_" + userId) || User.getProperty("pending_deeplink_" + userId) || "";74 75  if (pendingSlug !== "") {76    var productList = Bot.getProperty("stored_products") || [];77    var matchedIdx = -1;78 79    for (var p = 0; p < productList.length; p++) {80      var slug = String(productList[p].name || "").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");81      if (slug === pendingSlug.toLowerCase()) {82        matchedIdx = p;83        break;84      }85    }86 87    Bot.setProperty("pending_deeplink_" + userId, null, "string");88    User.setProperty("pending_deeplink_" + userId, null, "string");89 90    if (matchedIdx > -1) {91      // ⏳ STEP 1: LOADING MESSAGE92      var loadingText = "<blockquote>" +93        "<tg-emoji emoji-id='6147936236125298267'>⏳</tg-emoji> <b>Loading your product</b><tg-emoji emoji-id='6193006377389005214'>...</tg-emoji>\n" +94        "<i>Please wait a moment</i>" +95        "</blockquote>";96 97      var loadingMsg = Api.sendMessage({98        chat_id: chat.chatid,99        text: loadingText,100        parse_mode: "HTML"101      });102 103      var loadingMsgId = (loadingMsg && loadingMsg.result && loadingMsg.result.message_id) ? loadingMsg.result.message_id : null;104 105      // 💾 STEP 2: Save state for the delayed callback106      User.setProperty("dl_wait_msgid", loadingMsgId, "number");107      User.setProperty("dl_wait_prodidx", matchedIdx, "number");108      User.setProperty("dl_wait_chatid", String(chat.chatid), "string");109 110      // ⏳ STEP 3: 4-SECOND DELAY VIA HTTP CALLBACK (setTimeout ke bajaye)111      HTTP.get({112        url: "https://httpbin.org/delay/4",113        success: "/onDeepLinkPlanShow",114        error: "/onDeepLinkPlanShow"115      });116 117      return;118    }119  }120 121  // ✅ Koi pending deep-link nahi -> DIRECT MAIN MENU122  var userBal2 = "0.00";123  try {124    var res2 = 0;125    if (Libs && Libs.ResourcesLib) { res2 = Libs.ResourcesLib.userRes("balance").value() || 0; }126    var adminBal2 = Bot.getProperty("balance" + userId) || 0;127    userBal2 = (Number(res2) + Number(adminBal2)).toFixed(2);128  } catch (balErr2) {129    var fallbackBal2 = Bot.getProperty("balance" + userId) || 0;130    userBal2 = Number(fallbackBal2).toFixed(2);131  }132 133  var welcomeMessage2 =134    "<tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <b>— Panel Shop —</b> <tg-emoji emoji-id=\"5866053971960929280\">🏪</tg-emoji> <tg-emoji emoji-id=\"6266967801580231067\">💎</tg-emoji>\n\n" +135    "<tg-emoji emoji-id=\"6093677128295914531\">🎉</tg-emoji> <b>Hello, " + ((user && user.first_name) ? user.first_name.toUpperCase() : "RESELLER") + "!</b>\n\n" +136    "<tg-emoji emoji-id=\"6080228009439141516\">💧</tg-emoji> <b>Genuine, limited-stock books. Instant delivery.</b>\n\n" +137    "<tg-emoji emoji-id=\"6093591495237967001\">🌐</tg-emoji> Wide product catalog\n" +138    "<tg-emoji emoji-id=\"6215386799133433653\">🔑</tg-emoji> Instant delivery on payment\n" +139    "<tg-emoji emoji-id=\"6312263493051489212\">💰</tg-emoji> Multiple payment gateways\n" +140    "<tg-emoji emoji-id=\"6100170496077204999\">👑</tg-emoji> 24/7 admin support\n\n" +141    "<i>Balance: ₹" + userBal2 + "</i>\n\n" +142    "<i>Tap any button below to begin:</i> <tg-emoji emoji-id='6057415823222379852'>👇</tg-emoji>";143 144  var multiColorKeyboard2 = [145    [{ text: "Shop Now", callback_data: "/buy_hack", style: "primary", icon_custom_emoji_id: "5866053971960929280" }],146    [147      { text: "Profile", callback_data: "/profile", style: "primary", icon_custom_emoji_id: "5260399854500191689" },148      { text: "Add Balance", callback_data: "/addfund", style: "success", icon_custom_emoji_id: "6147815702163102310" }149    ],150    [151      { text: "My Keys", callback_data: "/mykey", style: "primary", icon_custom_emoji_id: "6113743082358841933" },152      { text: "How to use", callback_data: "/how", style: "danger", icon_custom_emoji_id: "6080214566191505147" }153    ],154    [{ text: "Refer & Earn", callback_data: "/referral", style: "success", icon_custom_emoji_id: "6093677128295914531" }],155        [{ text: "Support", callback_data: "/support", style: "danger", icon_custom_emoji_id: "5436113877181941026" }]156  ];157 158  Api.sendMessage({159    chat_id: chat.chatid,160    text: welcomeMessage2,161    parse_mode: "HTML",162    reply_markup: JSON.stringify({ inline_keyboard: multiColorKeyboard2 })163  });164 165} catch (err) {166  Bot.sendMessage("⚠️ System Error: " + err.message);167}
commands/_onContactRecieved.js · tarunpoonia905/OfcDevShopBot · TeleDevs