vimcord 1.0.56 → 1.0.58

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
@@ -273,6 +273,7 @@ var import_node_crypto = require("crypto");
273
273
  var BaseCommandBuilder = class {
274
274
  uuid = (0, import_node_crypto.randomUUID)();
275
275
  commandType;
276
+ name = "";
276
277
  /** Local command configuration and hooks */
277
278
  options;
278
279
  /** Internal state for rate limiting across different scopes */
@@ -292,6 +293,9 @@ var BaseCommandBuilder = class {
292
293
  this.commandType = type;
293
294
  this.options = { enabled: true, ...options };
294
295
  }
296
+ setCommandName(name) {
297
+ this.name = name;
298
+ }
295
299
  validateBaseConfig() {
296
300
  if (this.options.rateLimit) {
297
301
  const { max, interval } = this.options.rateLimit;
@@ -333,13 +337,12 @@ var BaseCommandBuilder = class {
333
337
  return await config.onConditionsNotMet?.(...args);
334
338
  }
335
339
  if (config.beforeExecute) {
336
- await config.beforeExecute?.({ cancel }, ...args);
340
+ await config.beforeExecute?.({ cancel, name: this.name }, ...args);
337
341
  if (canceled) return;
338
342
  }
339
343
  if (config.logExecution !== false) {
340
- const cmdName = this.options.name || this.builder?.name || "Unknown";
341
344
  const location = ctx.guild ? `${ctx.guild.name} (${ctx.guild.id})` : "Direct Messages";
342
- client.logger.commandExecuted(cmdName, ctx.user.username, location);
345
+ client.logger.commandExecuted(this.name || "Unknown", ctx.user.username, location);
343
346
  }
344
347
  const result = await config.execute?.(...args);
345
348
  await config.afterExecute?.(result, ...args);
@@ -483,6 +486,7 @@ var ContextCommandBuilder = class extends BaseCommandBuilder {
483
486
  setBuilder(builder) {
484
487
  this.builder = typeof builder === "function" ? builder(new import_discord2.ContextMenuCommandBuilder()) : builder;
485
488
  this.validateBuilder();
489
+ this.setCommandName(this.builder.name);
486
490
  return this;
487
491
  }
488
492
  setExecute(fn) {
@@ -825,6 +829,7 @@ var PrefixCommandBuilder = class extends BaseCommandBuilder {
825
829
  constructor(options) {
826
830
  super(1 /* Prefix */, options);
827
831
  this.options = options;
832
+ this.setCommandName(options.name);
828
833
  const originalExecute = this.options.execute;
829
834
  this.options.execute = async (client, message) => {
830
835
  return await this.handleExecution(client, message, originalExecute);
@@ -903,6 +908,7 @@ var SlashCommandBuilder = class extends BaseCommandBuilder {
903
908
  setBuilder(builder) {
904
909
  this.builder = typeof builder === "function" ? builder(new import_discord3.SlashCommandBuilder()) : builder;
905
910
  this.validateBuilder();
911
+ this.setCommandName(this.builder.name);
906
912
  return this;
907
913
  }
908
914
  addRoutes(...routes) {
@@ -1795,7 +1801,7 @@ var VimcordErrorHandler = class {
1795
1801
  var import_chalk2 = __toESM(require("chalk"));
1796
1802
 
1797
1803
  // package.json
1798
- var version = "1.0.55";
1804
+ var version = "1.0.57";
1799
1805
 
1800
1806
  // src/client/vimcord.logger.ts
1801
1807
  var clientLoggerFactory = (client) => new Logger({ prefixEmoji: "\u26A1", prefix: `vimcord (i${client.clientId})` }).extend({
@@ -3310,7 +3316,7 @@ var BetterCollector = class _BetterCollector {
3310
3316
  if (!this.message) return;
3311
3317
  if (this.collector) return;
3312
3318
  this.collector = this.message.createMessageComponentCollector({
3313
- idle: this.options?.idle ?? this.config.timeouts.collectorIdle,
3319
+ idle: this.options?.timeout ? void 0 : this.options?.idle ?? this.config.timeouts.collectorIdle,
3314
3320
  time: this.options?.timeout ?? this.config.timeouts.collectorTimeout,
3315
3321
  componentType: this.options?.type,
3316
3322
  max: this.options?.max,