vimcord 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -767,8 +767,9 @@ var EventBuilder = class _EventBuilder {
767
767
 
768
768
  // src/builders/prefixCommand.builder.ts
769
769
  var PrefixCommandBuilder = class extends BaseCommandBuilder {
770
- constructor(config) {
771
- super(1 /* Prefix */, config);
770
+ constructor(options) {
771
+ super(1 /* Prefix */, options);
772
+ this.options = options;
772
773
  const originalExecute = this.options.execute;
773
774
  this.options.execute = async (client, message) => {
774
775
  return await this.handleExecution(client, message, originalExecute);
@@ -1478,7 +1479,7 @@ var VimcordAppCommandManager = class {
1478
1479
  return this.commands.get(name);
1479
1480
  }
1480
1481
  /**
1481
- * Filters and returns commands based on deployment options
1482
+ * Filters and returns commands based on deployment options alphabetically
1482
1483
  */
1483
1484
  getAll(options) {
1484
1485
  const matchedCommands = /* @__PURE__ */ new Map();
@@ -1500,7 +1501,31 @@ var VimcordAppCommandManager = class {
1500
1501
  if (options?.globalOnly && deployment.global === false) continue;
1501
1502
  matchedCommands.set(name, cmd);
1502
1503
  }
1503
- return matchedCommands;
1504
+ return Array.from(matchedCommands.values()).sort((a, b) => a.builder.name.localeCompare(b.builder.name));
1505
+ }
1506
+ /**
1507
+ * Groups commands by category alphabetically
1508
+ */
1509
+ sortByCategory() {
1510
+ const categories = /* @__PURE__ */ new Map();
1511
+ for (const cmd of this.commands.values()) {
1512
+ const metadata = cmd.options.metadata;
1513
+ if (!metadata?.category) continue;
1514
+ let entry = categories.get(metadata.category);
1515
+ if (!entry) {
1516
+ entry = {
1517
+ name: metadata.category,
1518
+ emoji: metadata.categoryEmoji,
1519
+ commands: []
1520
+ };
1521
+ categories.set(metadata.category, entry);
1522
+ }
1523
+ entry.commands.push(cmd);
1524
+ }
1525
+ return Array.from(categories.values()).sort((a, b) => a.name.localeCompare(b.name)).map((cat) => {
1526
+ cat.commands.sort((a, b) => a.builder.name.localeCompare(b.builder.name));
1527
+ return cat;
1528
+ });
1504
1529
  }
1505
1530
  async registerGlobal(options) {
1506
1531
  const client = await this.client.whenReady();
@@ -1622,6 +1647,30 @@ var VimcordPrefixCommandManager = class {
1622
1647
  );
1623
1648
  });
1624
1649
  }
1650
+ /**
1651
+ * Groups commands by category alphabetically
1652
+ */
1653
+ sortByCategory() {
1654
+ const categories = /* @__PURE__ */ new Map();
1655
+ for (const cmd of this.commands.values()) {
1656
+ const metadata = cmd.options.metadata;
1657
+ if (!metadata?.category) continue;
1658
+ let entry = categories.get(metadata.category);
1659
+ if (!entry) {
1660
+ entry = {
1661
+ name: metadata.category,
1662
+ emoji: metadata.categoryEmoji,
1663
+ commands: []
1664
+ };
1665
+ categories.set(metadata.category, entry);
1666
+ }
1667
+ entry.commands.push(cmd);
1668
+ }
1669
+ return Array.from(categories.values()).sort((a, b) => a.name.localeCompare(b.name)).map((cat) => {
1670
+ cat.commands.sort((a, b) => a.options.name.localeCompare(b.options.name));
1671
+ return cat;
1672
+ });
1673
+ }
1625
1674
  async importFrom(dir, replaceAll = false) {
1626
1675
  if (replaceAll) this.commands.clear();
1627
1676
  const dirs = Array.isArray(dir) ? dir : [dir];
@@ -2261,7 +2310,7 @@ async function retryExponentialBackoff(fn, maxRetries = 3, retryDelay = 1e3) {
2261
2310
  }
2262
2311
 
2263
2312
  // package.json
2264
- var version = "1.0.22";
2313
+ var version = "1.0.23";
2265
2314
 
2266
2315
  // src/client.ts
2267
2316
  var import_node_crypto3 = require("crypto");