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/_removekey.js

javascript · 69 lines

Raw
1/**#command2name: /removekey3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var adminId = "8875810358"; // Aapki Admin ID14  if (String(chat.chatid) !== adminId) return;15 16  if (!params) {17    Bot.sendMessage("❌ <b>Usage:</b>\n<code>/removekey PRODUCT NAME | DAYS</code>\n\n<i>Example: DRIP CLIENT | 1_Day</i>", { parse_mode: "HTML" });18    return;19  }20 21  var args = params.split("|");22  if (args.length < 2) {23    Bot.sendMessage("❌ <b>Format Error!</b> Use Pipe symbol:\n<code>/removekey PRODUCT NAME | DAYS</code>", { parse_mode: "HTML" });24    return;25  }26 27  var prodName = args[0].trim();28  var planDays = args[1].trim();29  var cleanPlanDays = planDays.includes("_Day") ? planDays : planDays + "_Day";30 31  var stockKeyText = "stock_" + prodName + "_" + cleanPlanDays;32  var keyStock = Bot.getProperty(stockKeyText) || [];33 34  if (keyStock.length === 0) {35    Bot.sendMessage("❌ Product: <b>" + prodName + " (" + cleanPlanDays + ")</b> ka stock already empty hai!", { parse_mode: "HTML" });36    return;37  }38 39  var inlineButtons = [];40  41  // Har ek key ke liye ek individual delete button banana42  for (var i = 0; i < keyStock.length; i++) {43    var fullKey = keyStock[i];44    // Display ke liye key ka chota part dikhana taaki button bada na ho45    var shortKey = fullKey.length > 15 ? fullKey.substring(0, 12) + "..." : fullKey; 46    47    inlineButtons.push([48      {49        text: "🗑️ Key " + (i + 1) + " [" + shortKey + "]",50        // Callback me parameters pass karna: index_number | prodName | planDays51        callback_data: "/deletekey_now " + i + "|" + prodName + "|" + cleanPlanDays52      }53    ]);54  }55 56  var menuText = "<blockquote><b>🗑️ SELECT KEY TO REMOVE</b>\n\n" +57                 "• <b>Product:</b> <code>" + prodName + "</code>\n" +58                 "• <b>Plan:</b> <code>" + cleanPlanDays + "</code>\n" +59                 "• <b>Total Keys:</b> <code>" + keyStock.length + "</code>\n\n" +60                 "<i>Niche diye gaye buttons me se jis key ko remove karna hai, uspar click karein:</i></blockquote>";61 62  Bot.sendMessage(menuText, {63    parse_mode: "HTML",64    reply_markup: JSON.stringify({ inline_keyboard: inlineButtons })65  });66 67} catch (err) {68  Bot.sendMessage("⚠️ Error: " + err.message);69}