devbro468/Dev_x_store_botPublic · Bot Template

AIThis bot operates a digital storefront (DEV X STORE) selling subscription-based products — likely game hacks, accounts, or access keys — categorized by platform (Android Root, Non-Root, iPhone). It features a reseller program with discounted pricing, a dual-currency wallet (INR balance + Telegram Stars/XTR), and a full admin/co-admin panel for managing products, plans, per-plan pricing, stock (keys/accounts), coupons, and API endpoints. Purchases flow through a plan selection screen offering wallet payment, Stars invoices (sendInvoice with XTR currency), and coupon application. Successful Stars payments are handled via successful_payment webhook, crediting wallet or delivering keys directly. Admin tools include user listing with chunked messaging, stock viewing/deletion with inline keyboards, co-admin management, and API registry updates. The bot registers users on first interaction and

Commercecommercedigital-goodsstars-paymentreseller-systemadmin-panelstock-management
ProfileTelegram
119 commands0 envUpdated 15d agoCreated Aug 23, 2026
Back to folder

commands/_apiupdate.js

javascript · 24 lines

Raw
1/**#command2name: /apiupdate3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var ownerId=String(Bot.getProperty("owner_id")||"8875810358"), uid=String(chat.chatid), co=Bot.getProperty("co_admin_"+uid);14  if(uid!==ownerId && !co) return;15  var p=(params?String(params).trim():"").split("|").map(function(x){return x.trim();});16  if(p.length<3){ Bot.sendMessage("❌ Format: <code>/apiupdate ID | FIELD | VALUE</code>\nFields: name,url,api_key,master_key,mode,android_required,enabled",{parse_mode:"HTML"}); return; }17  var reg=Bot.getProperty("api_registry")||{}, id=p[0], field=p[1], value=p.slice(2).join("|");18  if(!reg[id]){Bot.sendMessage("❌ API ID not found: <code>"+id+"</code>",{parse_mode:"HTML"});return;}19  if(["name","url","api_key","master_key","mode"].indexOf(field)>=0) reg[id][field]=value;20  else if(field==="android_required" || field==="enabled") reg[id][field]=String(value).toLowerCase()==="true";21  else {Bot.sendMessage("❌ Invalid field.");return;}22  reg[id].updated_at=new Date().toISOString(); Bot.setProperty("api_registry",reg,"json");23  Bot.sendMessage("✅ <b>API Updated</b>\n<code>"+id+"</code> → <b>"+field+"</b>",{parse_mode:"HTML"});24} catch(e){Bot.sendMessage("⚠️ API Update Error: "+e.message);}