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/_rembal.js
javascript · 111 lines
1/**#command2name: /rembal3answer: 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 adminId = Bot.getProperty("owner_id") || "7127818616";19 var requesterId = String(user.telegramid);20 var isCoAdmin = Bot.getProperty("co_admin_" + requesterId);21 22 if ((requesterId !== String(adminId) && !Bot.getProperty("co_admin_" + String(requesterId))) && !isCoAdmin) {23 Bot.sendMessage("❌ You are not authorized to use this command.");24 return;25 }26 27 if (request && request.id) {28 try {29 try { Api.answerCallbackQuery({ callback_query_id: request.id }); } catch (__a1) {}30 } catch (e) {}31 }32 33 var raw = "";34 if (typeof params !== "undefined" && params) raw = String(params).trim();35 if (!raw && typeof message !== "undefined" && message) {36 var parts = String(message).trim().split(/\s+/);37 if (parts.length > 1) raw = parts.slice(1).join(" ").trim();38 }39 40 if (!raw || raw.indexOf("|") === -1) {41 User.setProperty("rembal_step", "waiting_input", "string");42 Bot.sendMessage(43 "💵 <b>Remove Balance</b>\n\n" +44 "User ID aur amount is format me bhejein:\n" +45 "<code>user_id|amount</code>\n\n" +46 "Example: <code>123456789|50</code>",47 { parse_mode: "HTML" }48 );49 return;50 }51 52 var splitData = raw.split("|");53 var targetUserId = String(splitData[0] || "").trim();54 var amountToRemove = Number(String(splitData[1] || "").trim());55 56 if (!/^\d+$/.test(targetUserId) || !isFinite(amountToRemove) || amountToRemove <= 0) {57 Bot.sendMessage("❌ Invalid format. Use <code>user_id|amount</code>.", { parse_mode: "HTML" });58 return;59 }60 61 var wallet = Libs.ResourcesLib.anotherUserRes("balance", targetUserId);62 var currentBalance = Number(wallet.value()) || 0;63 var legacyBalance = Number(Bot.getProperty("balance" + targetUserId) || 0);64 var totalBalance = currentBalance + legacyBalance;65 66 if (amountToRemove > totalBalance) {67 Bot.sendMessage(68 "❌ <b>Insufficient Balance</b>\n\n" +69 "Member balance: <code>₹" + totalBalance.toFixed(2) + "</code>\n" +70 "Remove requested: <code>₹" + amountToRemove.toFixed(2) + "</code>",71 { parse_mode: "HTML" }72 );73 return;74 }75 76 // Remove from the main ResourcesLib wallet first.77 var fromResource = Math.min(currentBalance, amountToRemove);78 if (fromResource > 0) wallet.remove(fromResource);79 80 // If old balance storage is still used, remove the remainder from it.81 var remainder = amountToRemove - fromResource;82 if (remainder > 0) {83 var newLegacy = Math.max(0, legacyBalance - remainder);84 Bot.setProperty("balance" + targetUserId, newLegacy, "float");85 }86 87 var afterBalance = (totalBalance - amountToRemove).toFixed(2);88 89 Bot.sendMessage(90 "✅ <b>Balance Removed</b>\n\n" +91 "Member: <code>" + targetUserId + "</code>\n" +92 "Removed: <code>₹" + amountToRemove.toFixed(2) + "</code>\n" +93 "Remaining: <code>₹" + afterBalance + "</code>",94 { parse_mode: "HTML" }95 );96 97 try {98 Api.sendMessage({99 chat_id: targetUserId,100 text:101 "<blockquote><b>💳 BALANCE UPDATED</b>\n\n" +102 "• Removed by Admin: <code>₹" + amountToRemove.toFixed(2) + "</code>\n" +103 "• Remaining Balance: <code>₹" + afterBalance + "</code>\n\n" +104 "Use /balance to check your wallet.</blockquote>",105 parse_mode: "HTML"106 });107 } catch (notifyErr) {}108 109} catch (err) {110 Bot.sendMessage("⚠️ <b>Remove Balance Error:</b> <code>" + err.message + "</code>", { parse_mode: "HTML" });111}