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/_addbal_binance.js
javascript · 115 lines
1/**#command2name: /addbal_binance3answer: 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// 🟡 "Binance Pay" chosen on Add Balance screen — shows the admin-set19// Binance QR (photo file_id OR image URL, whichever admin configured) with20// the amount converted to USD, plus Binance Pay ID + USDT Address.21// Koi live-verify API nahi hai, isliye "I Paid" ek manual Support flow22// shuru karta hai (UTR + screenshot -> admin ko forward).23// =========================================================24 25try {26 let userId = user.telegramid;27 let callbackId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;28 29 let inrAmount = String(parseInt(params ? String(params).trim() : "0"));30 if (!inrAmount || inrAmount === "0" || isNaN(parseInt(inrAmount)) || parseInt(inrAmount) <= 0) {31 Bot.sendMessage("❌ Invalid amount!");32 return;33 }34 35 let qrFileId = Bot.getProperty("binance_qr_file_id");36 let qrUrl = Bot.getProperty("binance_qr_url");37 let qrSource = qrFileId || qrUrl;38 39 let binanceId = Bot.getProperty("binance_pay_id");40 let usdtAddress = Bot.getProperty("binance_usdt_address");41 let usdRate = Number(Bot.getProperty("usd_rate") || 91);42 let usdAmount = (parseInt(inrAmount) / usdRate).toFixed(2);43 44 if (!qrSource || !binanceId || !usdtAddress) {45 if (callbackId) {46 Api.answerCallbackQuery({47 callback_query_id: String(callbackId),48 text: "⚠️ Binance Pay abhi configure nahi hua hai. Kripya Support se contact karein.",49 show_alert: true50 });51 }52 return;53 }54 55 User.setProperty("binance_pending_amount_inr", inrAmount, "string");56 User.setProperty("binance_pending_amount_usd", usdAmount, "string");57 58 let e_binance = "<tg-emoji emoji-id='6312263493051489212'>🟡</tg-emoji>";59 let e_check = "<tg-emoji emoji-id='6100657257605763582'>✔️</tg-emoji>";60 61 let caption =62 "<blockquote>" + e_binance + " <b>BINANCE PAY</b></blockquote>\n" +63 "━━━━━━━━━━━━━━━━━━━━━\n\n" +64 "<tg-emoji emoji-id='6312263493051489212'>💰</tg-emoji> <b>Amount:</b> $<code>" + usdAmount + "</code> <i>(₹" + inrAmount + ")</i>\n\n" +65 "<b>Binance Pay ID</b>\n<code>" + binanceId + "</code>\n\n" +66 "<b>USDT Address</b>\n<code>" + usdtAddress + "</code>\n\n" +67 "━━━━━━━━━━━━━━━━━━━━━\n" +68 "<tg-emoji emoji-id='6100170496077204999'>📋</tg-emoji> <b>Instructions</b>\n" +69 "• Scan the QR in your Binance app, or pay to the ID/Address above.\n" +70 "• Pay the exact amount shown.\n" +71 "• Tap <b>I Paid</b> below and follow the steps to submit proof.\n\n" +72 e_check + " <i>Support team will verify and credit your balance.</i>";73 74 let inlineButtons = [75 [{ text: "I Paid", callback_data: "/addbal_binance_paid", style: "success", icon_custom_emoji_id: "6100657257605763582" }],76 [{ text: "Cancel", callback_data: "/cancel_topup", style: "danger", icon_custom_emoji_id: "6219547832169273793" }]77 ];78 79 // Agar purani QR/generating message chat me hai, use hata do80 try {81 let genMsgId = Bot.getProperty("gen_msg_id_" + userId) || User.getProperty("gen_msg_id_" + userId);82 if (genMsgId) {83 try { Api.deleteMessage({ chat_id: chat.chatid, message_id: genMsgId }); } catch (e) {}84 Bot.setProperty("gen_msg_id_" + userId, null, "string");85 User.setProperty("gen_msg_id_" + userId, null, "string");86 }87 } catch (e) {}88 89 if (request && request.message && !request.message.photo) {90 try { Api.deleteMessage({ chat_id: chat.chatid, message_id: request.message.message_id }); } catch (e) {}91 }92 93 let sentMsg = Api.sendPhoto({94 chat_id: chat.chatid,95 photo: qrSource,96 caption: caption,97 parse_mode: "HTML",98 reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })99 });100 101 try {102 let qrMsgId = (sentMsg && sentMsg.result && sentMsg.result.message_id) ? sentMsg.result.message_id : (sentMsg && sentMsg.message_id ? sentMsg.message_id : null);103 if (qrMsgId) {104 Bot.setProperty("qr_msg_id_" + userId, qrMsgId, "string");105 User.setProperty("qr_msg_id_" + userId, qrMsgId, "string");106 }107 } catch (e) {}108 109 if (callbackId) {110 Api.answerCallbackQuery({ callback_query_id: String(callbackId) });111 }112 113} catch (err) {114 Bot.sendMessage("⚠️ System Error: " + err.message);115}