indrajitghosh20006/HgfhhuybotPublic · Bot Template

ProfileTelegram

AIThis bot provides a command‑based admin interface for managing user balances, products, and resellers. It supports adding balances via UPI or Binance Pay, approving payments, and configuring product details and categories. The bot also handles user role changes, stock uploads, and offers a simple calculator UI for entering amounts. All interactions are handled through short commands and inline keyboards, with no long‑running listeners or external frameworks.

Utilityadminbalanceproductresellerpaymentupi
138 commands0 envUpdated 15h agoCreated Sep 27, 2026
Back to folder

commands/_setproductapi.js

javascript · 23 lines

Raw
1/**#command2name: /setproductapi3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var ownerId=String(Bot.getProperty("owner_id")||"7839151435"), 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<2){Bot.sendMessage("❌ Format: <code>/setproductapi PRODUCT_INDEX | API_ID</code>",{parse_mode:"HTML"});return;}17  var idx=Number(p[0]), apiId=p[1], products=Bot.getProperty("stored_products")||[], reg=Bot.getProperty("api_registry")||{};18  if(!products[idx]){Bot.sendMessage("❌ Product index not found.");return;}19  if(!reg[apiId]){Bot.sendMessage("❌ API ID not found. Use /apilist");return;}20  products[idx].api_id=apiId;21  Bot.setProperty("stored_products",products,"json");22  Bot.sendMessage("✅ <b>Product API Updated</b>\nProduct: <code>"+String(products[idx].name)+"</code>\nAPI: <code>"+apiId+"</code>",{parse_mode:"HTML"});23} catch(e){Bot.sendMessage("⚠️ Product API Error: "+e.message);}