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/_toggle_gateway.js
javascript · 84 lines
1/**#command2name: /toggle_gateway3answer: 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 currentChatId = String(chat.chatid);20 var isCoAdmin = Bot.getProperty("co_admin_" + currentChatId);21 if ((currentChatId !== adminId && !Bot.getProperty("co_admin_" + String(currentChatId))) && !isCoAdmin) {22 Bot.sendMessage("❌ Restricted command!");23 return;24 }25 26 var flagKey = params ? String(params).trim() : "";27 if (!flagKey) { return; }28 29 // FamPay ko ON karne se pehle credentials configured hone chahiye.30 if (flagKey === "gateway_upi_enabled") {31 var upiCurrent = Bot.getProperty(flagKey) !== false;32 if (!upiCurrent) {33 var upiConfigured = !!(Bot.getProperty("paytm_upi") || Bot.getProperty("payment_upi_id") || "paytm.s1tk6od@pty") &&34 !!(Bot.getProperty("paytm_merchant_id") || "SDfRhW21109811758334") && !!(Bot.getProperty("paytm_merchant_key") || "SDfRhW21109811758334");35 if (!upiConfigured) {36 var uqid = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;37 if (uqid) { try { Api.answerCallbackQuery({ callback_query_id: String(uqid), text: "⚠️ Pehle Paytm UPI/Merchant ID/Merchant Key set karo!", show_alert: true }); } catch (e) {} }38 return;39 }40 }41 Bot.setProperty(flagKey, !upiCurrent, "boolean");42 } else if (flagKey === "gateway_fampay_enabled") {43 var current = Bot.getProperty(flagKey) === true;44 if (!current) {45 var configured = !!(Bot.getProperty("fampay_merchant_key") || Bot.getProperty("fampay_api_key"));46 if (!configured) {47 var qid = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;48 if (qid) {49 try {50 Api.answerCallbackQuery({ callback_query_id: String(qid), text: "⚠️ Pehle FamPay UPI/API keys set karo!", show_alert: true });51 } catch (e) {}52 }53 return;54 }55 }56 Bot.setProperty(flagKey, !current, "boolean");57 } else if (flagKey === "gateway_manual_enabled") {58 var mCurrent = Bot.getProperty(flagKey) === true;59 if (!mCurrent && !(Bot.getProperty("manual_qr_file_id") && Bot.getProperty("manual_upi_id"))) {60 var mqid = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;61 if (mqid) { try { Api.answerCallbackQuery({ callback_query_id: String(mqid), text: "⚠️ Pehle Manual QR aur UPI ID set karo!", show_alert: true }); } catch (e) {} }62 return;63 }64 Bot.setProperty(flagKey, !mCurrent, "boolean");65 } else if (flagKey === "gateway_zapupi_enabled") {66 var zCurrent = Bot.getProperty(flagKey) === true;67 if (!zCurrent && !Bot.getProperty("zapupi_key")) {68 var zqid = request ? (request.id || (request.callback_query && request.callback_query.id)) : null;69 if (zqid) {70 try { Api.answerCallbackQuery({ callback_query_id: String(zqid), text: "⚠️ Pehle Zapupi key set karo!", show_alert: true }); } catch (e) {}71 }72 return;73 }74 Bot.setProperty(flagKey, !zCurrent, "boolean");75 } else {76 var currentDefault = (Bot.getProperty(flagKey) !== false);77 Bot.setProperty(flagKey, !currentDefault, "boolean");78 }79 80 Bot.run({ command: "/admin_gateways" });81 82} catch (err) {83 Bot.sendMessage("⚠️ Gateway Toggle Error: " + err.message);84}