indrajitghosh20006/Testseller_01botPublic · Bot Template
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
commands/_dailygift.js
javascript · 52 lines
1/**#command2name: /dailygift3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// 🎰 LUCKY SPIN — once every 24 hours, random ₹0.00–₹0.50, credited to wallet.13try {14 var userId = user.telegramid;15 var chatId = chat.chatid;16 var lastSpinTime = User.getProperty("last_lucky_spin_time");17 var now = new Date().getTime();18 var cooldown = 24 * 60 * 60 * 1000;19 20 if (lastSpinTime && now - Number(lastSpinTime) < cooldown) {21 var left = cooldown - (now - Number(lastSpinTime));22 var sec = Math.floor(left / 1000), h = Math.floor(sec / 3600), m = Math.floor((sec % 3600) / 60), s = sec % 60;23 var text = "<blockquote><tg-emoji emoji-id='5893163582194978381'>❌</tg-emoji> <b>LUCKY SPIN ALREADY USED!</b>\n━━━━━━━━━━━━━━━━━━━━━\n\n" +24 "👋 Hello <b>" + user.first_name + "</b>, aapka aaj ka Lucky Spin already use ho chuka hai.\n\n" +25 "<tg-emoji emoji-id='5260450573768990626'>➡️</tg-emoji> <b>Next Spin In:</b> <code>" + h + "h " + m + "m " + s + "s</code>\n\n" +26 "<tg-emoji emoji-id='6194911182499881916'>🗣</tg-emoji> <i>Har 24 ghante me 1 Lucky Spin.</i></blockquote>";27 var kb=[[{text:"Back to Menu",callback_data:"/back",style:"danger",icon_custom_emoji_id:"5893163582194978381"}]];28 if(request&&request.message&&request.message.message_id) Api.editMessageText({chat_id:String(chatId),message_id:Number(request.message.message_id),text:text,parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:kb})});29 else Api.sendMessage({chat_id:String(chatId),text:text,parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:kb})});30 return;31 }32 33 // Inclusive 0.00–0.50 range, rounded to paise.34 var rewardAmount = Math.floor(Math.random() * 51) / 100;35 Libs.ResourcesLib.userRes("balance").add(rewardAmount);36 User.setProperty("last_lucky_spin_time", now, "number");37 // Migrate old daily-gift cooldown state so users cannot claim both systems.38 User.setProperty("last_daily_gift_time", now, "number");39 var updatedBal = Number(Libs.ResourcesLib.userRes("balance").value() || 0).toFixed(2);40 41 var spinText = "<blockquote><tg-emoji emoji-id='6192822213486321961'>🎰</tg-emoji> <b>LUCKY SPIN</b>\n━━━━━━━━━━━━━━━━━━━━━\n\n" +42 "<tg-emoji emoji-id='6298298582982199311'>🎲</tg-emoji> <i>Spinning your lucky reward...</i>\n\n" +43 "<tg-emoji emoji-id='6194922667242429131'>🎉</tg-emoji> <b>Congratulations " + user.first_name + "!</b>\n" +44 "<tg-emoji emoji-id='6064514463564831610'>💰</tg-emoji> <b>You Won:</b> <code>₹" + rewardAmount.toFixed(2) + "</code>\n\n" +45 "━━━━━ <tg-emoji emoji-id='5346024644635804737'>🔰</tg-emoji> <b>WALLET UPDATE</b> ━━━━━\n" +46 "<tg-emoji emoji-id='6064138396228392033'>💵</tg-emoji> <b>New Balance:</b> ₹" + updatedBal + "\n\n" +47 "<tg-emoji emoji-id='6194911182499881916'>🗣</tg-emoji> <i>Come back after 24 hours for another spin!</i></blockquote>";48 var buttons=[[{text:"Back to Menu",callback_data:"/back",style:"success",icon_custom_emoji_id:"5893163582194978381"}]];49 if(request&&request.message&&request.message.message_id) Api.editMessageText({chat_id:String(chatId),message_id:Number(request.message.message_id),text:spinText,parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:buttons})});50 else Api.sendMessage({chat_id:String(chatId),text:spinText,parse_mode:"HTML",reply_markup:JSON.stringify({inline_keyboard:buttons})});51 if(request&&request.id){try{Api.answerCallbackQuery({callback_query_id:String(request.id)});}catch(e){}}52} catch(err) { Bot.sendMessage("⚠️ <b>Lucky Spin Error:</b> <code>"+err.message+"</code>",{parse_mode:"HTML"}); }