indrajitghosh20006/Testseller_01botPublic · Bot Template

ProfileTelegram

AIThis bot provides an admin‑controlled system for managing user balances, products, and reseller roles. It includes commands to add balances (via manual input, Binance Pay, or UPI), approve and credit payments, and set up product listings with categories and pricing. Admins can also add resellers, view reseller info, and manage stock entries. The bot uses built‑in TeleBotHost APIs such as Bot, Api, HTTP, and Libs for database operations and message handling.

Commerceadminbalanceproductresellerpaymentsbinance
138 commands0 envUpdated 17h agoCreated Sep 27, 2026
Back to folder

commands/_set_demo_video.js

javascript · 38 lines

Raw
1/**#command2name: /set_demo_video3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var adminId=Bot.getProperty("owner_id")||"7839151435";14  var cid=String(chat.chatid);15  if(cid!==String(adminId)&&!Bot.getProperty("co_admin_"+cid)){Bot.sendMessage("❌ You are not the admin!");return;}16 17  var raw = params ? String(params).trim() : "";18  if(raw){19    var p=raw.split("|");20    var name=p[0].trim();21    var video=p.slice(1).join("|").trim();22    var list=Bot.getProperty("stored_products")||[], idx=-1;23    for(var i=0;i<list.length;i++) if(String(list[i].name||"").toLowerCase()===name.toLowerCase()){idx=i;break;}24    if(idx<0){Bot.sendMessage("❌ Product not found!");return;}25    if(video){26      list[idx].demo_video=video; Bot.setProperty("stored_products",list,"json");27      Bot.sendMessage("📹 <b>Demo Video Saved!</b>\n\n📦 Product: <b>"+list[idx].name+"</b>\n▶️ Demo Video button ab product ke andar dikhega.",{parse_mode:"HTML"});28      return;29    }30    User.setProperty("demo_video_product_idx",idx,"string");31    User.setProperty("demo_video_step","waiting_video","string");32    Bot.sendMessage("📹 <b>Upload Demo Video</b>\n\n📦 Product: <b>"+list[idx].name+"</b>\n\nAb isi chat me <b>video upload/send</b> karein. Bot automatically us video ko demo ke roop me save karega.",{parse_mode:"HTML"});33    return;34  }35 36  User.setProperty("demo_video_step","waiting_product_name","string");37  Bot.sendMessage("📹 <b>SET DEMO VIDEO</b>\n\nPehle jis <b>product</b> me demo video lagani hai uska exact name bhejein.\n\nUske baad aapko <b>video upload</b> karne ka prompt milega.",{parse_mode:"HTML"});38}catch(e){Bot.sendMessage("❌ Error: "+e.message);}