yaainnnxitstore/YASIN_XIT_BOTPublic · Bot Template
AIYASIN XIT FREE KEY appears to be a Telegram automation bot. Commands include /menu, /addfund, /confirm_buyitem, /rembal, /sendorderkey_input, /removeproduct, /add_reseller, /addkey. Observed in code: messaging, keyboards, payments, games, libs, web.
Utilityutility
140 commands0 envUpdated 1mo agoCreated Sep 11, 2026
commands/_manual_order.js
javascript · 110 lines
1/**#command2name: /manual_order3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12function __esc(v){return String(v==null?"":v).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");}13var __swfUpdate = (typeof update !== "undefined" && update) ? update : null;14var __swfCb = (__swfUpdate && __swfUpdate.callback_query) ? __swfUpdate.callback_query : null;15var __swfCbMsg = (__swfCb && __swfCb.message) ? __swfCb.message : null;16var __swfMsgId = __swfCbMsg && __swfCbMsg.message_id ? Number(__swfCbMsg.message_id) : 0;17var __swfCbId = __swfCb && __swfCb.id ? String(__swfCb.id) : "";18try {19 if (typeof request !== "undefined" && request && __swfCb) {20 if (__swfCb.message) request.message = __swfCb.message;21 if (!request.id && __swfCb.id) request.id = __swfCb.id;22 }23} catch(__swf_norm_err) {}24function __swfEditMessage(a) {25 a = a || {};26 var mid = Number(a.message_id || __swfMsgId || 0);27 var cid = a.chat_id || (typeof chat !== "undefined" && chat ? (chat.id || chat.chatid) : null);28 if (!mid || !cid) throw new Error("Callback message ID not found");29 var markup = a.reply_markup;30 if (typeof markup === "string") { try { markup = JSON.parse(markup); } catch(_) {} }31 var base = {chat_id:cid,message_id:mid,parse_mode:a.parse_mode,reply_markup:markup};32 var cm = __swfCbMsg;33 if (cm && (cm.photo || cm.video || cm.document || cm.audio || cm.animation)) {34 return Api.editMessageCaption({chat_id:cid,message_id:mid,caption:String(a.text == null ? "" : a.text),parse_mode:a.parse_mode,reply_markup:markup});35 }36 return Api.editMessageText({chat_id:cid,message_id:mid,text:String(a.text == null ? "" : a.text),parse_mode:a.parse_mode,reply_markup:markup});37}38function __uiSend(text, opts) {39 opts = opts || {};40 var req = (typeof request !== "undefined" && request) ? request : null;41 var chatId = (typeof chat !== "undefined" && chat && chat.chatid) ? chat.chatid : null;42 var isCallback = !!__swfCb;43 var mid = 0;44 if (isCallback && update.callback_query.message && update.callback_query.message.message_id) mid = Number(update.callback_query.message.message_id);45 if (!mid) { try { mid = Number(User.getProperty("pending_menu_message_id") || User.getProperty("main_menu_message_id") || User.getProperty("support_message_id") || 0); } catch(e0) { mid = 0; } }46 var markup = opts.reply_markup;47 if (markup && typeof markup !== "string") { try { markup = JSON.stringify(markup); } catch(e1) {} }48 var textValue = String(text == null ? "" : text);49 if (mid && chatId) {50 try {51 __swfEditMessage({chat_id:chatId,message_id:mid,text:textValue,parse_mode:opts.parse_mode,reply_markup:markup});52 try { User.setProperty("main_menu_message_id",String(mid),"string"); User.setProperty("pending_menu_message_id",String(mid),"string"); } catch(se) {}53 return true;54 } catch(e2) {55 var s=String(e2).toLowerCase();56 if(s.indexOf("message is not modified")>=0 || s.indexOf("not modified")>=0) return true;57 if(isCallback && update.callback_query.message && update.callback_query.message.photo) {58 try { Api.editMessageCaption({chat_id:chatId,message_id:mid,caption:textValue,parse_mode:opts.parse_mode,reply_markup:markup}); return true; } catch(e3) {59 var s3=String(e3).toLowerCase(); if(s3.indexOf("not modified")>=0) return true;60 }61 }62 if(isCallback) { try { Api.answerCallbackQuery({callback_query_id:String(update.callback_query.id),text:"⚠️ Could not update the screen.",show_alert:true}); } catch(e4) {} return false; }63 }64 }65 if (isCallback) { try { Api.answerCallbackQuery({callback_query_id:String(update.callback_query.id),text:"⚠️ Screen message not found.",show_alert:true}); } catch(e5) {} return false; }66 try {67 var sent=Api.sendMessage({chat_id:chatId,text:textValue,parse_mode:opts.parse_mode,reply_markup:markup});68 try { if(sent&&sent.message_id){User.setProperty("pending_menu_message_id",String(sent.message_id),"string");User.setProperty("main_menu_message_id",String(sent.message_id),"string");} } catch(e6) {}69 return true;70 } catch(e7) { return false; }71}72try{73 var uid=String(user.telegramid), owner=String(Bot.getProperty("owner_id")||"8225479428");74 var activeExisting=String(User.getProperty("active_manual_order")||"");75 if(activeExisting){var existingRec=Bot.getProperty("manual_order_"+activeExisting);if(existingRec && !["cancelled","rejected","delivered"].includes(String(existingRec.status||""))){__uiSend("⚠️ <b>You already have an active order.</b>\n🧾 <code>"+activeExisting+"</code>", {parse_mode:"HTML"});return;} User.setProperty("active_manual_order","");}76 var parts=String(params||"").trim().split(/\s+/);77 var products=Bot.getProperty("stored_products")||[];78 var pi=Number(parts[0]), pli=Number(parts[1]);79 var product=products[pi], plan=product&&product.plans?product.plans[pli]:null;80 if(!product||!plan){__uiSend("❌ Order plan not found.");return;}81 var stock=Number(plan.stock_count||0);82 if(stock<=0){__uiSend("❌ This plan is currently out of stock.",{parse_mode:"HTML"});return;}83 var price=Number(plan.normal_price!=null?plan.normal_price:plan.price||0);84 var orderId="ORD_"+Date.now()+"_"+Math.floor(Math.random()*10000);85 var rec={id:orderId,user_id:uid,name:((user.first_name||"")+" "+(user.last_name||"")).trim()||"User",username:user.username?String(user.username):"None",product_name:String(product.name),product_index:pi,plan_index:pli,duration:String(plan.durationDisplay||plan.days+" Days"),days:String(plan.days),amount:price,currency:"USD",status:"awaiting_payment",created_at:new Date().toISOString()};86 Bot.setProperty("manual_order_"+orderId,rec,"json");87 Bot.setProperty("total_orders_count", Number(Bot.getProperty("total_orders_count")||0)+1, "number");88 var manualOrderDateKey=new Date().toISOString().slice(0,10);89 Bot.setProperty("today_orders_"+manualOrderDateKey, Number(Bot.getProperty("today_orders_"+manualOrderDateKey)||0)+1, "number");90 var userOrderIds=Bot.getProperty("user_order_ids_"+uid)||[]; if(Array.isArray(userOrderIds)) userOrderIds=userOrderIds.slice();if(!Array.isArray(userOrderIds))userOrderIds=[];userOrderIds.push(orderId);if(userOrderIds.length>100)userOrderIds=userOrderIds.slice(-100);Bot.setProperty("user_order_ids_"+uid,userOrderIds,"json");91 var list=Bot.getProperty("pending_manual_orders")||[]; if(Array.isArray(list)) list=list.slice();if(!Array.isArray(list))list=[];list.push(orderId);Bot.setProperty("pending_manual_orders",list,"json");92 User.setProperty("active_manual_order",orderId,"string");93 var payInfo=String(Bot.getProperty("manual_payment_info")||"");94 if(!payInfo){95 var mPayId=String(Bot.getProperty("binance_pay_id")||"").trim();96 payInfo = mPayId ? "🆔 Binance Pay ID: <code>"+mPayId+"</code>"97 : "🟡 Payments are not configured yet. Please contact the administrator.";98 }99 var text="<blockquote>🛒 <b>ORDER CREATED</b></blockquote>\n\n"+100 "📦 <b>Product:</b> "+__esc(product.name)+"\n"+101 "⏳ <b>Duration:</b> "+rec.duration+"\n"+102 "💰 <b>Amount:</b> $"+price.toFixed(2)+"\n"+103 "🧾 <b>Order:</b> <code>"+orderId+"</code>\n\n"+104 "💳 <b>BINANCE PAY</b>\n"+payInfo+"\n\n"+105 "📄 After paying, tap the <b>Send Receipt</b> button.";106 __uiSend(text,{parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:[107 [{text:"📄 Send Receipt",callback_data:"/manual_receipt "+orderId}],108 [{text:"❌ Cancel Order",callback_data:"/cancel_manual_order "+orderId}]109 ]})});110}catch(e){__uiSend("⚠️ Could not create the order: "+String(e.message||e));}