← back to browse
goat command

blackmarket

List or show blackmarket commands

0
views
0
likes
0
installs

Aliases: bm

raw source
const axios = require("axios");

const cmdsInfoUrl = "https://raw.githubusercontent.com/Azadwebapi/Azadx69x-bm-store/main/cmdsinfo.json";
const cmdsUrlJson = "https://raw.githubusercontent.com/Azadwebapi/Azadx69x-bm-store/main/cmdsurl.json";
const ITEMS_PER_PAGE = 10;

module.exports = {
  config: {
    name: "blackmarket",
    aliases: ["bm"],
    version: "1.2",
    author: "Azadx69x",
    role: 0,
    shortDescription: "List or show blackmarket commands",
    category: "market"
  },

  onStart: async function({ message, args }) {
    try {
      const action = args[0]?.toLowerCase();

      if (!action) {  
        return message.reply(
          `๐ŸŒธ๐—ช๐—ฒ๐—น๐—ฐ๐—ผ๐—บ๐—ฒ ๐˜๐—ผ ๐—•๐—น๐—ฎ๐—ฐ๐—ธ ๐— ๐—ฎ๐—ฟ๐—ธ๐—ฒ๐˜๐ŸŒธ
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
Type bm list <page> to see all commands.
Type bm show <command>.js to get the raw link.`
        );  
      }  
      
      const [infoRes, urlRes] = await Promise.all([
        axios.get(cmdsInfoUrl),
        axios.get(cmdsUrlJson)
      ]);

      let cmdsInfo = Array.isArray(infoRes.data) ? infoRes.data : infoRes.data.cmdName || [];
      const cmdsUrls = urlRes?.data || {};

      if (action === "list") {
        if (!cmdsInfo.length) return message.reply("โŒ No commands found!");

        const page = Math.max(1, Number(args[1]) || 1);
        const totalPages = Math.ceil(cmdsInfo.length / ITEMS_PER_PAGE);

        if (page > totalPages) return message.reply(`โŒ Invalid page number! 1-${totalPages}`);

        const start = (page - 1) * ITEMS_PER_PAGE;
        const cmdsPage = cmdsInfo.slice(start, start + ITEMS_PER_PAGE);

        let text = `๐Ÿ’€๐—•๐—น๐—ฎ๐—ฐ๐—ธ ๐— ๐—ฎ๐—ฟ๐—ธ๐—ฒ๐˜ ๐—–๐—ผ๐—บ๐—บ๐—ฎ๐—ป๐—ฑ๐˜€๐Ÿ’€
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
`;

        cmdsPage.forEach((c, i) => {
          text += `
โ•ญโ”€ ๐Ÿ†” ๐—ก๐šž๐—บ๐—ฏ๐—ฒ๐—ฟ: ${start + i + 1} โ”€โ•ฎ
โ”‚ โ•ฐโ”€โฏ ๐Ÿ›’ ๐—ก๐—ฎ๐—บ๐—ฒ   : ${c.cmd}
โ”‚ โ•ฐโ”€โฏ โš™๏ธ ๐—จ๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ : ${c.update}
โ”‚ โ•ฐโ”€โฏ ๐Ÿ‘จโ€๐Ÿ’ป ๐—”๐˜‚๐˜๐—ต๐—ผ๐—ฟ : ${c.author}
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
`;
        });

        text += `๐Ÿ—‚๏ธ Page ${page}/${totalPages} โ€” Type "bm list ${page + 1}" for next page.`;

        return message.reply(text.trim());
      }

      if (action === "show") {
        const cmdName = args[1]?.toLowerCase().endsWith(".js") ? args[1].slice(0, -3) : args[1];
        if (!cmdName) return message.reply("โŒ Example: bm show chudi.js");

        const cmd = cmdsInfo.find(c => c.cmd.toLowerCase() === cmdName.toLowerCase());
        const cmdUrl = cmdsUrls?.[cmdName];

        if (!cmd || !cmdUrl) return message.reply(`โŒ Command "${cmdName}" not found!`);

        const now = new Date().toLocaleString("en-GB");

        const boxText = `โ•ญโ”€โ”€๐‚๐ฆ๐ ๐”๐ฉ๐ฅ๐จ๐š๐๐ž๐ ๐’๐ฎ๐œ๐œ๐ž๐ฌ๐ฌ๐Ÿ๐ฎ๐ฅโ”€โ”€โ•ฎ
โ”†~๐Ÿ“ ๐—ก๐—ฎ๐—บ๐—ฒ
โ•ฐโ”€โฏ ${cmdName}
โ”†~๐Ÿ‘จโ€๐Ÿ’ป ๐—”๐˜‚๐˜๐—ต๐—ผ๐—ฟ
โ•ฐโ”€โฏ ${cmd.author}
โ”†~๐Ÿ“… ๐—จ๐—ฝ๐—ฑ๐—ฎ๐˜๐—ฒ๐—ฑ ๐—”๐˜
โ•ฐโ”€โฏ ${now}
โ”†~โšก ๐—ฆ๐˜๐—ฎ๐˜๐˜‚๐˜€
โ•ฐโ”€โฏ โœ… Uploaded Successfully
โ”†~๐Ÿ“Œ ๐—ฅ๐—ฎ๐˜„ ๐—™๐—ถ๐—น๐—ฒ ๐—Ÿ๐—ถ๐—ป๐—ธ
โ•ฐโ”€โฏ ${cmdUrl}
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ`;

        return message.reply(boxText);
      }

      return message.reply("โŒ Invalid option!");

    } catch (err) {
      return message.reply(`โŒ Error: ${err.message}`);
    }
  }
};

View raw file