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/_withdraw_request.js
javascript · 100 lines
1/**#command2name: /withdraw_request3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13 var __bgUid = String(user.telegramid);14 if (Bot.getProperty("banned_" + __bgUid) === true && __bgUid !== String(Bot.getProperty("owner_id") || "8225479428")) {15 try {16 if (typeof update !== "undefined" && update && update.callback_query) Api.answerCallbackQuery({callback_query_id:String(update.callback_query.id),text:"🚫 Your account has been suspended.",show_alert:true});17 else Api.sendMessage({chat_id: chat.chatid, text: "🚫 <b>ACCESS DENIED</b>\n\nYour account has been suspended by the administrator.", parse_mode: "HTML"});18 } catch(__bgSend) {}19 return;20 }21} catch(__bgErr) {}22function __esc(v){return String(v==null?"":v).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");}23var __swfUpdate = (typeof update !== "undefined" && update) ? update : null;24var __swfCb = (__swfUpdate && __swfUpdate.callback_query) ? __swfUpdate.callback_query : null;25var __swfCbMsg = (__swfCb && __swfCb.message) ? __swfCb.message : null;26var __swfMsgId = __swfCbMsg && __swfCbMsg.message_id ? Number(__swfCbMsg.message_id) : 0;27var __swfCbId = __swfCb && __swfCb.id ? String(__swfCb.id) : "";28try {29 if (typeof request !== "undefined" && request && __swfCb) {30 if (__swfCb.message) request.message = __swfCb.message;31 if (!request.id && __swfCb.id) request.id = __swfCb.id;32 }33} catch(__swf_norm_err) {}34function __swfEditMessage(a) {35 a = a || {};36 var mid = Number(a.message_id || __swfMsgId || 0);37 var cid = a.chat_id || (typeof chat !== "undefined" && chat ? (chat.id || chat.chatid) : null);38 if (!mid || !cid) throw new Error("Callback message ID not found");39 var markup = a.reply_markup;40 if (typeof markup === "string") { try { markup = JSON.parse(markup); } catch(_) {} }41 var base = {chat_id:cid,message_id:mid,parse_mode:a.parse_mode,reply_markup:markup};42 var cm = __swfCbMsg;43 if (cm && (cm.photo || cm.video || cm.document || cm.audio || cm.animation)) {44 return Api.editMessageCaption({chat_id:cid,message_id:mid,caption:String(a.text == null ? "" : a.text),parse_mode:a.parse_mode,reply_markup:markup});45 }46 return Api.editMessageText({chat_id:cid,message_id:mid,text:String(a.text == null ? "" : a.text),parse_mode:a.parse_mode,reply_markup:markup});47}48function __uiSend(text, opts) {49 opts = opts || {};50 var req = (typeof request !== "undefined" && request) ? request : null;51 var chatId = (typeof chat !== "undefined" && chat && chat.chatid) ? chat.chatid : null;52 var isCallback = !!__swfCb;53 var mid = 0;54 if (isCallback && update.callback_query.message && update.callback_query.message.message_id) mid = Number(update.callback_query.message.message_id);55 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; } }56 var markup = opts.reply_markup;57 if (markup && typeof markup !== "string") { try { markup = JSON.stringify(markup); } catch(e1) {} }58 var textValue = String(text == null ? "" : text);59 if (mid && chatId) {60 try {61 __swfEditMessage({chat_id:chatId,message_id:mid,text:textValue,parse_mode:opts.parse_mode,reply_markup:markup});62 try { User.setProperty("main_menu_message_id",String(mid),"string"); User.setProperty("pending_menu_message_id",String(mid),"string"); } catch(se) {}63 return true;64 } catch(e2) {65 var s=String(e2).toLowerCase();66 if(s.indexOf("message is not modified")>=0 || s.indexOf("not modified")>=0) return true;67 if(isCallback && update.callback_query.message && update.callback_query.message.photo) {68 try { Api.editMessageCaption({chat_id:chatId,message_id:mid,caption:textValue,parse_mode:opts.parse_mode,reply_markup:markup}); return true; } catch(e3) {69 var s3=String(e3).toLowerCase(); if(s3.indexOf("not modified")>=0) return true;70 }71 }72 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; }73 }74 }75 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; }76 try {77 var sent=Api.sendMessage({chat_id:chatId,text:textValue,parse_mode:opts.parse_mode,reply_markup:markup});78 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) {}79 return true;80 } catch(e7) { return false; }81}82try{83 var uid=String(user.telegramid), MIN_WITHDRAW=5;84 var total=Number(Bot.getProperty("referral_earnings_"+uid)||0),withdrawn=Number(Bot.getProperty("referral_withdrawn_"+uid)||0);85 var avail=Number(Bot.getProperty("referral_available_"+uid)); if(!isFinite(avail)) avail=Math.max(0,total-withdrawn);86 var existing=Bot.getProperty("withdraw_request_"+uid);87 if(existing && String(existing.status||"")==="pending"){__uiSend("⏳ <b>You already have a pending withdrawal request.</b>",{parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:[[{text:"🔙 Back",callback_data:"/earnings"}]]})});return;}88 if(avail<MIN_WITHDRAW){__uiSend("⚠️ <b>Minimum withdrawal is $"+MIN_WITHDRAW.toFixed(2)+".</b>\nYour available balance: $"+avail.toFixed(2),{parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:[[{text:"🔙 Back",callback_data:"/earnings"}]]})});return;}89 var reqId="WDR_"+Date.now()+"_"+Math.floor(Math.random()*10000);90 var name=((user.first_name||"")+(user.last_name?" "+user.last_name:"")).trim()||"User";91 var rec={id:reqId,user_id:uid,name:name,username:user.username?String(user.username):"None",amount:avail,status:"pending",created_at:new Date().toISOString()};92 Bot.setProperty("withdraw_request_"+uid,rec,"json");93 var list=Bot.getProperty("pending_withdrawals")||[];if(Array.isArray(list))list=list.slice();if(!Array.isArray(list))list=[];list.push(uid);Bot.setProperty("pending_withdrawals",list,"json");94 var adminId=String(Bot.getProperty("owner_id")||"8225479428");95 try{Api.sendMessage({chat_id:adminId,parse_mode:"HTML",96 text:"💸 <b>WITHDRAWAL REQUEST</b>\n━━━━━━━━━━━━━━━━━━\n\n👤 User: "+name+" "+(user.username?String(user.username):"None")+"\n🆔 User ID: <code>"+uid+"</code>\n💵 Amount: <b>$"+avail.toFixed(2)+"</b>\n🧾 Request: <code>"+reqId+"</code>",97 reply_markup:JSON.stringify({inline_keyboard:[[{text:"✅ Approve",callback_data:"/withdraw_approve "+uid},{text:"❌ Reject",callback_data:"/withdraw_reject "+uid}]]})});}catch(e1){}98 __uiSend("✅ <b>Withdrawal request sent!</b>\n\n💵 Amount: $"+avail.toFixed(2)+"\n🧾 Request: <code>"+reqId+"</code>\n\n<i>The administrator will review it shortly.</i>",99 {parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:[[{text:"🔙 Back",callback_data:"/earnings"}]]})});100}catch(e){__uiSend("⚠️ Could not send the request: "+e.message);}