ayushyadav7970824760/goldensellingstore_botPublic · Bot Template

AIThis Telegram store bot lets customers browse digital products and plans, apply coupons, add funds via UPI, and receive purchased keys. It includes a full admin panel for managing products, reordering items, setting reseller prices, viewing and removing key stock, configuring UPI payment details and update links, and checking user balances. Co-admins and resellers are supported, and support tickets are forwarded to the admin.

Commercedigital_storeadmin_panelupi_paymentsresellercouponskey_stock
ProfileTelegram
146 commands0 envUpdated 2d agoCreated Sep 5, 2026
Back to folder

commands/_backup_firebase.js

javascript · 61 lines

Raw
1/**#command2name: /backup_firebase3answer: 4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: false9is_web: 010#command**/11 12// =========================================================13// 🔥 ADMIN PANEL — "Backup to Firebase"14// Bot ka critical data (products/plans, users list, key settings) Firebase15// Realtime Database me push karta hai (safety-net backup). Ye poori bot16// ki storage layer ko Firebase pe migrate NAHI karta — sirf ek snapshot17// backup hai jo admin manually (ya periodically) chala sakta hai.18// =========================================================19 20try {21  var adminId = Bot.getProperty("owner_id") || "8477746023";22  var isCoAdmin0 = Bot.getProperty("co_admin_" + String(chat.chatid));23  if (String(chat.chatid) !== adminId && !isCoAdmin0) {24    Bot.sendMessage("❌ You are not authorized to use this.");25    return;26  }27 28  var snapshot = {29    backed_up_at: new Date().toISOString(),30    stored_products: Bot.getProperty("stored_products") || [],31    all_users_list: Bot.getProperty("all_users_list") || [],32    payment_upi_id: Bot.getProperty("payment_upi_id") || null,33    binance_pay_id: Bot.getProperty("binance_pay_id") || null,34    binance_usdt_address: Bot.getProperty("binance_usdt_address") || null,35    sale_channel_id: Bot.getProperty("sale_channel_id") || null,36    support_link: Bot.getProperty("support_link") || null,37    support_username: Bot.getProperty("support_username") || null,38    update_channel_link: Bot.getProperty("update_channel_link") || null,39    custom_welcome_text: Bot.getProperty("custom_welcome_text") || null,40    upi_payment_mode: Bot.getProperty("upi_payment_mode") || "auto"41  };42 43  var firebaseUrl = "https://ayush-nova-smm-default-rtdb.firebaseio.com/bot_backups.json";44 45  HTTP.post({46    url: firebaseUrl,47    body: snapshot48  });49 50  Bot.sendMessage(51    "<blockquote>🔥 <b>BACKUP SENT TO FIREBASE!</b></blockquote>\n\n" +52    "📦 <b>Products backed up:</b> " + snapshot.stored_products.length + "\n" +53    "👥 <b>Users backed up:</b> " + snapshot.all_users_list.length + "\n\n" +54    "<i>Firebase Console → Realtime Database → \"bot_backups\" me check kar sakte hain.</i>\n\n" +55    "⚠️ <i>Agar data Firebase me nahi dikh raha, apne Database Rules check karein — write allow hona chahiye.</i>",56    { parse_mode: "HTML" }57  );58 59} catch (err) {60  Bot.sendMessage("⚠️ Error: " + err.message);61}