vimcord 1.0.55 → 1.0.56
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 +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +6 -1
- 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
|
@@ -316,6 +316,8 @@ var BaseCommandBuilder = class {
|
|
|
316
316
|
async run(client, ...args) {
|
|
317
317
|
const config = this.resolveConfig(client);
|
|
318
318
|
const ctx = this.extractContext(args);
|
|
319
|
+
let canceled = false;
|
|
320
|
+
const cancel = () => canceled = true;
|
|
319
321
|
try {
|
|
320
322
|
if (!config.enabled) {
|
|
321
323
|
return await config.onUsedWhenDisabled?.(...args);
|
|
@@ -330,7 +332,10 @@ var BaseCommandBuilder = class {
|
|
|
330
332
|
if (!await this.checkConditions(config, ...args)) {
|
|
331
333
|
return await config.onConditionsNotMet?.(...args);
|
|
332
334
|
}
|
|
333
|
-
|
|
335
|
+
if (config.beforeExecute) {
|
|
336
|
+
await config.beforeExecute?.({ cancel }, ...args);
|
|
337
|
+
if (canceled) return;
|
|
338
|
+
}
|
|
334
339
|
if (config.logExecution !== false) {
|
|
335
340
|
const cmdName = this.options.name || this.builder?.name || "Unknown";
|
|
336
341
|
const location = ctx.guild ? `${ctx.guild.name} (${ctx.guild.id})` : "Direct Messages";
|