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/_press.js
javascript · 204 lines
1/**#command2name: /press3answer: 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// Command Name: /press (Premium Calculator Keypad Handler)18// ✅ FIXED: "Back" button pehle "/dmenu" call kar raha tha jo bot me exist hi nahi karta19// (dead button — click karne par kuch nahi hota tha). Ab "/back" (real menu command) use hota hai.20// ✅ Number buttons ab addfund screen jaisi hi blue "primary" styling ke saath hain (pehle plain/colorless the).21 22try {23 // Purana set default check: Agar user ne naya deposit shuru kiya hai toh default 0 rahe24 let current_amount = User.getProperty("deposit_amount");25 if (!current_amount) {26 current_amount = "0";27 }28 29 let pressed = params ? params.trim() : "";30 let queryId = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;31 32 // 💎 Premium Emoji Set (same IDs as /addfund — keeps the screen visually identical, no flicker)33 let e_money = "<tg-emoji emoji-id='6312263493051489212'>💰</tg-emoji>";34 let e_clear = "<tg-emoji emoji-id='5348224471050238603'>✏</tg-emoji>";35 let e_confirm = "<tg-emoji emoji-id='5348191451341668809'>✅</tg-emoji>";36 let e_back = "<tg-emoji emoji-id='5893163582194978381'>⬅️</tg-emoji>";37 let e_hour = "<tg-emoji emoji-id='6100657257605763582'>✔️</tg-emoji>";38 let e_check = "<tg-emoji emoji-id='6311870645277825763'>✔️</tg-emoji>";39 let e_gear = "<tg-emoji emoji-id='5348292765325212780'>⚙</tg-emoji>";40 41 // --- CONFIRM BUTTON CLICK ---42 if (pressed == "confirm") {43 if (parseInt(current_amount) <= 0 || current_amount == "" || current_amount == "0") {44 if (queryId) {45 Api.answerCallbackQuery({46 callback_query_id: queryId,47 text: "👀 PLEASE ENTER A VALID AMOUNT!",48 show_alert: true49 });50 }51 return;52 }53 54 // ✅ NEW: ab seedhe QR generate nahi hota — pehle "Choose Payment Method"55 // screen dikhti hai (UPI Pay / Binance Pay), jaise buyitem checkout me hoti hai.56 let finalAmount = String(parseInt(current_amount));57 let usdRate = Number(Bot.getProperty("usd_rate") || 91);58 let usdAmount = (parseInt(current_amount) / usdRate).toFixed(2);59 60 let e_upi = "<tg-emoji emoji-id='5348392971207194994'>💳</tg-emoji>";61 let e_binance = "<tg-emoji emoji-id='6312263493051489212'>🟡</tg-emoji>";62 let e_fampay = "<tg-emoji emoji-id='6312263493051489212'>🟣</tg-emoji>";63 64 // ✅ NEW: gateways ab admin toggle se control hote hain — jo OFF hai wo65 // yahan dikhega hi nahi. Default: UPI/Paytm aur Binance ON (jaise pehle66 // se chal rahe the), FamPay OFF jab tak admin explicitly ON na kare.67 let upiEnabled = (Bot.getProperty("gateway_upi_enabled") !== false);68 let binanceEnabled = (Bot.getProperty("gateway_binance_enabled") !== false);69 let fampayEnabled = (Bot.getProperty("gateway_fampay_enabled") === true);70 let zapupiEnabled = (Bot.getProperty("gateway_zapupi_enabled") === true);71 72 // ⚡ DIRECT QR: amount confirm hote hi seedha QR (Choose Payment Method screen skip).73 // Priority: UPI -> FamPay -> Zapupi. Sirf Binance ON ho to purani screen dikhegi.74 // ✋ Manual Payment (owner's own QR) — ON + configured ho to sabse upar.75 if (Bot.getProperty("gateway_manual_enabled") === true && Bot.getProperty("manual_qr_file_id") && Bot.getProperty("manual_upi_id")) {76 User.setProperty("deposit_amount", "0", "string");77 Bot.run({ command: "/manualpay", options: { params: "show " + finalAmount } });78 return;79 }80 let directAddCmd = upiEnabled ? "/addbal_upi" : (fampayEnabled ? "/addbal_fampay" : (zapupiEnabled ? "/addbal_zapupi" : null));81 if (directAddCmd) {82 User.setProperty("deposit_amount", "0", "string");83 Bot.run({ command: directAddCmd, options: { params: finalAmount } });84 return;85 }86 87 let methodText =88 "<blockquote>" + e_money + " <b>CHOOSE PAYMENT METHOD</b></blockquote>\n" +89 "━━━━━━━━━━━━━━━━━━━━━\n\n" +90 e_money + " <b>Amount:</b> ₹<code>" + finalAmount + "</code> <i>(≈ $" + usdAmount + ")</i>\n\n" +91 "━━━━━━━━━━━━━━━━━━━━━\n" +92 "<i>Select a payment gateway below:</i>";93 94 let methodButtons = [];95 if (upiEnabled) {96 methodButtons.push([{ text: "Pay ₹" + finalAmount, callback_data: "/addbal_upi " + finalAmount, style: "success", icon_custom_emoji_id: "5348392971207194994" }]);97 }98 if (fampayEnabled) {99 methodButtons.push([{ text: "Pay ₹" + finalAmount, callback_data: "/addbal_fampay " + finalAmount, style: "success", icon_custom_emoji_id: "6312263493051489212" }]);100 }101 if (zapupiEnabled) {102 methodButtons.push([{ text: "Pay ₹" + finalAmount, callback_data: "/addbal_zapupi " + finalAmount, style: "success", icon_custom_emoji_id: "5348392971207194994" }]);103 }104 if (binanceEnabled) {105 methodButtons.push([{ text: "Binance Pay $" + usdAmount, callback_data: "/addbal_binance " + finalAmount, style: "primary", icon_custom_emoji_id: "6312263493051489212" }]);106 }107 methodButtons.push([{ text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }]);108 109 if (methodButtons.length === 1) {110 // Sirf "Back" bacha — matlab koi gateway ON nahi hai111 methodButtons.unshift([{ text: "⚠️ No payment method available", callback_data: "/addfund", style: "danger" }]);112 }113 114 Api.editMessageText({115 chat_id: chat.chatid,116 message_id: request.message.message_id,117 text: methodText,118 parse_mode: "HTML",119 reply_markup: JSON.stringify({ inline_keyboard: methodButtons })120 });121 122 // Amount reset to 0 so next time it starts fresh123 User.setProperty("deposit_amount", "0", "string");124 125 if (queryId) {126 Api.answerCallbackQuery({ callback_query_id: queryId });127 }128 129 return;130 }131 132 // --- KEYPAD INPUT LOGIC ---133 if (pressed == "clear") {134 if (current_amount.length > 1) {135 current_amount = current_amount.slice(0, -1);136 } else {137 current_amount = "0";138 }139 } else if (pressed !== "") {140 if (current_amount == "0") {141 current_amount = pressed;142 } else {143 if ((current_amount + pressed).length <= 6) {144 current_amount = current_amount + pressed;145 }146 }147 }148 149 // Save current keypad amount state150 User.setProperty("deposit_amount", current_amount, "string");151 152 if (queryId) {153 Api.answerCallbackQuery({ callback_query_id: queryId });154 }155 156 // 🎨 Keypad Buttons — same premium colored styling as /addfund157 let inlineKeyboardPayload = [158 [159 { text: "1", callback_data: "/press 1", style: "primary" },160 { text: "2", callback_data: "/press 2", style: "primary" },161 { text: "3", callback_data: "/press 3", style: "primary" }162 ],163 [164 { text: "4", callback_data: "/press 4", style: "primary" },165 { text: "5", callback_data: "/press 5", style: "primary" },166 { text: "6", callback_data: "/press 6", style: "primary" }167 ],168 [169 { text: "7", callback_data: "/press 7", style: "primary" },170 { text: "8", callback_data: "/press 8", style: "primary" },171 { text: "9", callback_data: "/press 9", style: "primary" }172 ],173 [174 { text: "Clear", callback_data: "/press clear", style: "danger", icon_custom_emoji_id: "5348224471050238603" },175 { text: "0", callback_data: "/press 0", style: "primary" },176 { text: "Confirm", callback_data: "/press confirm", style: "success", icon_custom_emoji_id: "5348191451341668809" }177 ],178 [179 // ✅ FIXED: "/dmenu" -> "/back" (dead command replaced with the real menu handler)180 { text: "Back", callback_data: "/back", style: "danger", icon_custom_emoji_id: "5893163582194978381" }181 ]182 ];183 184 let keypadMsg =185 "<blockquote>" + e_money + " <b>ADD BALANCE — ENTER AMOUNT</b> <tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji></blockquote>\n" +186 "━━━━━━━━━━━━━━━━━━━━━\n\n" +187 "<tg-emoji emoji-id='6312263493051489212'>💎</tg-emoji> <b>Amount:</b> ₹<code>" + current_amount + "</code>\n\n" +188 "━━━━━━━━━━━━━━━━━━━━━\n" +189 e_check + " <i>Instant Auto-Credit</i>\n" +190 "<tg-emoji emoji-id='6215386799133433653'>🔒</tg-emoji> <i>100% Secure UPI Payment</i>\n" +191 e_hour + " <i>Verified in Seconds</i>\n\n" +192 "<tg-emoji emoji-id='6100170496077204999'>👑</tg-emoji> <i>Use the keypad below to enter amount</i>";193 194 Api.editMessageText({195 chat_id: chat.chatid,196 message_id: request.message.message_id,197 text: keypadMsg,198 parse_mode: "HTML",199 reply_markup: JSON.stringify({ inline_keyboard: inlineKeyboardPayload })200 });201 202} catch (err) {203 Bot.sendMessage("⚠️ System Error in Keypad: " + err.message);204}