vimcord 1.0.57 → 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 +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
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(
|
|
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) {
|