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

javascript · 78 lines

Raw
1/**#command2name: /normalprice_id3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12try {13  var adminId = "8875810358";14  if (!chat || String(chat.chatid) !== adminId) return;15 16  // 🔥 CLEAR SPINNER IMMEDIATELY17  if (typeof request !== "undefined" && request) {18    let queryId = request.id || (request.callback_query && request.callback_query.id);19    if (queryId) { try { Api.answerCallbackQuery({ callback_query_id: queryId }); } catch(qErr){} }20  }21 22  // Pure parameter context safe extraction23  var rawInput = (typeof message !== "undefined" && message) ? message.trim() : "";24  if (!rawInput && typeof params !== "undefined" && params) { rawInput = String(params).trim(); }25 26  // Command structural cleanup27  if (rawInput.indexOf("/normalprice_id") === 0) {28    rawInput = rawInput.replace("/normalprice_id", "").trim();29  }30 31  // 🛡️ NO REPLY CRASH FIX: Display input instruction explicitly if text is completely blank32  if (!rawInput) {33    Api.sendMessage({34      chat_id: adminId,35      text: "✍️ <b>Set Normal Price Node Matrix:</b>\n\nKripya is text ko copy karein, edit karein aur reply mein bhejiye:\n\n<code>/normalprice_id [Category Name] [Price]</code>\n\n<b>Example:</b>\n<code>/normalprice_id Facebook Id 150</code>",36      parse_mode: "HTML"37    });38    return;39  }40 41  var parts = rawInput.split(" ");42  if (parts.length < 2) {43    Api.sendMessage({44      chat_id: adminId,45      text: "⚠️ <b>Format Galat Hai!</b>\nSahi tarika: <code>Category_Name Price</code>\nExample: <code>Facebook Id 150</code>",46      parse_mode: "HTML"47    });48    return;49  }50 51  var price = parts[parts.length - 1].trim();52  var catName = parts.slice(0, -1).join(" ").trim();53 54  if (isNaN(price)) {55    Api.sendMessage({ chat_id: adminId, text: "⚠️ <b>Price ek valid number hona chahiye!</b>" });56    return;57  }58 59  var catSlug = catName.toLowerCase().replace(/[^a-z0-9]/g, "");60  var categories = Bot.getProperty("ff_categories") || {};61 62  if (!categories[catSlug]) {63    Api.sendMessage({ chat_id: adminId, text: "❌ <b>Category [ " + catName + " ] system records mein nahi mili!</b>" });64    return;65  }66 67  categories[catSlug].normal_price = parseFloat(price);68  Bot.setProperty("ff_categories", categories, "json");69 70  Api.sendMessage({71    chat_id: adminId,72    text: "✅ <b>Normal Price Updated Successfully!</b>\n\n• <b>Category:</b> <code>" + categories[catSlug].name + "</code>\n• <b>New Normal Price:</b> <code>₹" + price + "</code>",73    parse_mode: "HTML"74  });75 76} catch(e) {77  Bot.sendMessage("Error in Set Normal Price: " + e.message);78}