commandkit 1.2.0-dev.20250927124318 → 1.2.0-rc.10
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/LICENSE +5 -0
- package/dist/{EventWorkerContext-XNgriym3.d.ts → EventWorkerContext-DNWfsE1t.d.ts} +2 -2
- package/dist/analytics/analytics-engine.d.ts +1 -1
- package/dist/analytics/analytics-engine.js +1 -1
- package/dist/analytics/analytics-provider.d.ts +1 -1
- package/dist/analytics/utils.js +1 -1
- package/dist/{analytics-engine-AaAl3kQM.d.ts → analytics-engine-jVeSoxEk.d.ts} +19 -3
- package/dist/app/commands/AppCommandRunner.d.ts +1 -1
- package/dist/app/commands/AppCommandRunner.js +1 -1
- package/dist/app/commands/Context.d.ts +1 -1
- package/dist/app/commands/Context.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +2 -2
- package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
- package/dist/app/handlers/AppCommandHandler.js +1 -1
- package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
- package/dist/app/handlers/AppEventsHandler.js +1 -1
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +1 -1
- package/dist/app/middlewares/permissions.d.ts +1 -1
- package/dist/app/middlewares/permissions.js +1 -1
- package/dist/app/register/CommandRegistrar.d.ts +1 -1
- package/dist/app/register/CommandRegistrar.js +1 -1
- package/dist/{build-B5qTswWF.js → build-DB_aX5xt.js} +2 -2
- package/dist/{build-B5qTswWF.js.map → build-DB_aX5xt.js.map} +1 -1
- package/dist/cli/build.d.ts +1 -1
- package/dist/cli/build.js +2 -2
- package/dist/cli/common.d.ts +1 -1
- package/dist/cli/development.js +2 -2
- package/dist/cli/information.js +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/production.js +2 -2
- package/dist/{commandkit-ZoBBh0Q_.js → commandkit-lhbfAyX9.js} +12 -11
- package/dist/{commandkit-ZoBBh0Q_.js.map → commandkit-lhbfAyX9.js.map} +1 -1
- package/dist/commandkit.d.ts +1 -1
- package/dist/commandkit.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/v1/button/Button.js +1 -1
- package/dist/components/v1/button/ButtonKit.js +1 -1
- package/dist/components/v1/modal/Modal.js +1 -1
- package/dist/components/v1/modal/ModalKit.js +1 -1
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/SelectMenu.js +1 -1
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +1 -1
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +1 -1
- package/dist/config/config.d.ts +2 -2
- package/dist/config/config.js +1 -1
- package/dist/config/default.d.ts +1 -1
- package/dist/config/default.js +1 -1
- package/dist/config/loader.d.ts +1 -1
- package/dist/config/loader.js +1 -1
- package/dist/config/types.d.ts +1 -1
- package/dist/config/utils.d.ts +1 -1
- package/dist/{config-D-JMp2IO.d.ts → config-YAQdMBqh.d.ts} +2 -2
- package/dist/context/async-context.d.ts +1 -1
- package/dist/context/async-context.js +1 -1
- package/dist/context/environment.d.ts +1 -1
- package/dist/context/environment.js +1 -1
- package/dist/events/CommandKitEventsChannel.d.ts +1 -1
- package/dist/{feature-flags-CKNrjgqg.js → feature-flags-DnnKABHf.js} +2 -2
- package/dist/{feature-flags-CKNrjgqg.js.map → feature-flags-DnnKABHf.js.map} +1 -1
- package/dist/flags/FlagProvider.d.ts +1 -1
- package/dist/flags/feature-flags.d.ts +1 -1
- package/dist/flags/feature-flags.js +2 -2
- package/dist/flags/store.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{init-_7_QDifv.js → init-CY7OJPF-.js} +2 -2
- package/dist/{init-_7_QDifv.js.map → init-CY7OJPF-.js.map} +1 -1
- package/dist/logger/DefaultLogger.js +1 -1
- package/dist/logger/Logger.js +1 -1
- package/dist/plugins/CompilerPlugin.d.ts +1 -1
- package/dist/plugins/PluginCommon.d.ts +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +1 -1
- package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
- package/dist/plugins/types.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils/dev-hooks.d.ts +1 -1
- package/dist/utils/dev-hooks.js +1 -1
- package/dist/utils/utilities.js +1 -1
- package/dist/{version-C4nfLsvQ.js → version-BCILNeQb.js} +2 -2
- package/dist/{version-C4nfLsvQ.js.map → version-BCILNeQb.js.map} +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/COPYING.md +0 -684
package/LICENSE
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Copyright 2025 Avraj Sahota
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
|
|
4
|
+
|
|
5
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandKit } from "./analytics-engine-
|
|
1
|
+
import { CommandKit } from "./analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import { ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
|
|
@@ -40,4 +40,4 @@ declare function getEventWorkerContext(): EventWorkerContext;
|
|
|
40
40
|
declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
43
|
-
//# sourceMappingURL=EventWorkerContext-
|
|
43
|
+
//# sourceMappingURL=EventWorkerContext-DNWfsE1t.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEngine, FilterFunction } from "../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-DL3ucTiT.js');
|
|
2
2
|
require('../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-C6GtfAPW.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-
|
|
1
|
+
import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
package/dist/analytics/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-DL3ucTiT.js');
|
|
2
2
|
require('../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-C6GtfAPW.js');
|
|
@@ -63,6 +63,21 @@ interface CommandMetadata {
|
|
|
63
63
|
*/
|
|
64
64
|
nameAliases?: Record<'user' | 'message', string>;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use `CommandMetadata` instead.
|
|
68
|
+
*/
|
|
69
|
+
interface LegacyCommandMetadata {
|
|
70
|
+
/**
|
|
71
|
+
* The aliases of the command.
|
|
72
|
+
* @deprecated Use `metadata.aliases` or `generateMetadata` instead.
|
|
73
|
+
*/
|
|
74
|
+
aliases?: string[];
|
|
75
|
+
/**
|
|
76
|
+
* The guilds that the command is available in.
|
|
77
|
+
* @deprecated Use `metadata.guilds` or `generateMetadata` instead.
|
|
78
|
+
*/
|
|
79
|
+
guilds?: string[];
|
|
80
|
+
}
|
|
66
81
|
/**
|
|
67
82
|
* Represents a command that can be executed by CommandKit.
|
|
68
83
|
*/
|
|
@@ -71,7 +86,7 @@ type CommandData = Prettify<Omit<RESTPostAPIApplicationCommandsJSONBody, 'descri
|
|
|
71
86
|
* The description of the command.
|
|
72
87
|
*/
|
|
73
88
|
description?: string;
|
|
74
|
-
}>;
|
|
89
|
+
} & LegacyCommandMetadata>;
|
|
75
90
|
/**
|
|
76
91
|
* Represents an event handler for a specific event.
|
|
77
92
|
*/
|
|
@@ -2080,6 +2095,7 @@ declare class CommandKit extends EventEmitter {
|
|
|
2080
2095
|
/**
|
|
2081
2096
|
* Create a new command and event handler with CommandKit.
|
|
2082
2097
|
* @param options - The default CommandKit configuration.
|
|
2098
|
+
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
2083
2099
|
*/
|
|
2084
2100
|
constructor(options?: CommandKitOptions);
|
|
2085
2101
|
/**
|
|
@@ -2244,5 +2260,5 @@ declare class AnalyticsEngine {
|
|
|
2244
2260
|
track(event: AnalyticsEvent): Promise<void>;
|
|
2245
2261
|
}
|
|
2246
2262
|
//#endregion
|
|
2247
|
-
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitCompilerOptions, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventHandler, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment, useStore };
|
|
2248
|
-
//# sourceMappingURL=analytics-engine-
|
|
2263
|
+
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitCompilerOptions, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventHandler, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, LegacyCommandMetadata, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment, useStore };
|
|
2264
|
+
//# sourceMappingURL=analytics-engine-jVeSoxEk.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-
|
|
1
|
+
import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../analytics-engine-
|
|
1
|
+
import "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -29,5 +29,5 @@ import "../../CommandsRouter-CoOA7hkf.js";
|
|
|
29
29
|
import "../../EventsRouter-BacqK6z3.js";
|
|
30
30
|
import "../../index-CUPkUUOR.js";
|
|
31
31
|
import "../../constants-MKu-Q1jh.js";
|
|
32
|
-
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-
|
|
32
|
+
import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-DNWfsE1t.js";
|
|
33
33
|
export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-
|
|
1
|
+
import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-
|
|
1
|
+
import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
package/dist/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-
|
|
1
|
+
import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../ModalKit-Btz58KYn.js";
|
package/dist/app/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-DL3ucTiT.js');
|
|
2
2
|
require('../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../commandkit-
|
|
4
|
+
const require_commandkit = require('../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-C6GtfAPW.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-
|
|
1
|
+
import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-jVeSoxEk.js";
|
|
2
2
|
import "../../EventInterceptor-x-R2qshQ.js";
|
|
3
3
|
import "../../ButtonKit-C7r7RPNf.js";
|
|
4
4
|
import "../../ModalKit-Btz58KYn.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../../colors-DL3ucTiT.js');
|
|
2
2
|
require('../../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../../error-codes-Ds0bnPvT.js');
|
|
4
|
-
const require_commandkit = require('../../commandkit-
|
|
4
|
+
const require_commandkit = require('../../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../../common-CcfjYnPG.js');
|
|
6
6
|
require('../../common-vnMIelAE.js');
|
|
7
7
|
require('../../container-C6GtfAPW.js');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-nOFOJqeH.js');
|
|
2
|
-
const require_commandkit = require('./commandkit-
|
|
2
|
+
const require_commandkit = require('./commandkit-lhbfAyX9.js');
|
|
3
3
|
const require_constants = require('./constants-B5_Ta7PR.js');
|
|
4
4
|
const require_utils = require('./utils-KsNof0Xz.js');
|
|
5
5
|
const require_common = require('./common-CrqwC-sx.js');
|
|
@@ -171,4 +171,4 @@ Object.defineProperty(exports, 'buildApplication', {
|
|
|
171
171
|
return buildApplication;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
//# sourceMappingURL=build-
|
|
174
|
+
//# sourceMappingURL=build-DB_aX5xt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-
|
|
1
|
+
{"version":3,"file":"build-DB_aX5xt.js","names":[],"sources":["../src/cli/build.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { rimraf } from 'rimraf';\nimport type { Options } from 'tsdown';\n\nimport { MaybeArray } from '../components';\nimport { loadConfigFile } from '../config/loader';\nimport { mergeDeep } from '../config/utils';\nimport { CompilerPlugin, CompilerPluginRuntime } from '../plugins';\nimport { COMMANDKIT_CWD } from '../utils/constants';\nimport { copyLocaleFiles, loadTsdown } from './common';\nimport { devEnvFileArgs, prodEnvFileArgs } from './env';\nimport { performTypeCheck } from './type-checker';\n\n/**\n * @private\n * @internal\n */\nexport interface ApplicationBuildOptions {\n plugins?: MaybeArray<CompilerPlugin>[] | Array<CompilerPlugin>;\n rolldownPlugins?: any[];\n isDev?: boolean;\n configPath?: string;\n}\n\n// emit public env variables and given env variables\n/**\n * @private\n * @internal\n */\nfunction mergeDefinitionsIfNeeded(env: Record<string, string>, isDev: boolean) {\n const values = Object.fromEntries(\n Object.entries(process.env).filter(\n ([k]) => !(k in env) && k.startsWith('COMMANDKIT_PUBLIC_'),\n ),\n );\n\n return {\n ...env,\n ...values,\n ...(isDev\n ? {\n NODE_ENV: 'development',\n COMMANDKIT_BOOTSTRAP_MODE: 'development',\n COMMANDKIT_IS_DEV: 'true',\n COMMANDKIT_IS_TEST: 'false',\n }\n : {\n NODE_ENV: 'production',\n COMMANDKIT_BOOTSTRAP_MODE: 'production',\n COMMANDKIT_IS_DEV: 'false',\n COMMANDKIT_IS_TEST: 'false',\n }),\n };\n}\n\n/**\n * @private\n * @internal\n */\nexport async function buildApplication({\n plugins,\n rolldownPlugins,\n isDev,\n configPath,\n}: ApplicationBuildOptions) {\n const { build } = await loadTsdown();\n const config = await loadConfigFile(configPath);\n\n if (!isDev && !config?.typescript?.ignoreBuildErrors) {\n await performTypeCheck(configPath || COMMANDKIT_CWD);\n }\n\n const pluginRuntime = new CompilerPluginRuntime(\n (plugins || []) as CompilerPlugin[],\n );\n\n rolldownPlugins ??= [];\n\n rolldownPlugins.push(pluginRuntime.toJSON());\n\n try {\n const dest = isDev ? '.commandkit' : config.distDir;\n\n // Clean the destination directory\n await rimraf(dest);\n\n await pluginRuntime.init();\n\n await build(\n mergeDeep(\n {\n watch: false,\n dts: false,\n clean: true,\n format: ['esm'],\n shims: true,\n minify: false,\n silent: !!isDev,\n inputOptions: {\n transform: {\n jsx: {\n runtime: 'automatic',\n importSource: 'commandkit',\n },\n },\n checks: {\n circularDependency: true,\n },\n onwarn: (warning, defaultWarn) => {\n if (warning?.message?.includes('compilerOptions.jsx')) return;\n\n return defaultWarn(warning);\n },\n onLog: (level, log, defaultLog) => {\n if (isDev) return;\n\n return defaultLog(level, log);\n },\n moduleTypes: {\n '.json': 'json',\n '.node': 'binary',\n },\n },\n plugins: rolldownPlugins,\n platform: 'node',\n skipNodeModulesBundle: true,\n sourcemap:\n config.sourceMap?.[isDev ? 'development' : 'production'] ?? true,\n target: 'node16',\n outDir: dest,\n env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),\n entry: Array.from(\n new Set([\n 'src/**/*.{js,cjs,mjs,ts,cts,mts,jsx,tsx}',\n `!${config.distDir}`,\n '!.commandkit',\n '!**/*.test.*',\n '!**/*.spec.*',\n ...(config.entrypoints ?? []),\n ]),\n ),\n outputOptions: {\n sanitizeFileName: (name) => name,\n },\n unbundle: isDev\n ? true\n : (config.compilerOptions?.disableChunking ?? false),\n } satisfies Options,\n config.compilerOptions?.tsdown,\n ),\n );\n\n await copyLocaleFiles('src', dest);\n await injectEntryFile(\n configPath || COMMANDKIT_CWD,\n !!isDev,\n !!(\n config.antiCrashScript?.[isDev ? 'development' : 'production'] ??\n (isDev ? true : false)\n ),\n config.distDir,\n );\n } catch (error) {\n console.error('Build failed:', error);\n if (error instanceof Error) {\n console.error('Error details:', error.stack);\n }\n process.exit(1); // Force exit on error\n } finally {\n // Ensure plugins are cleaned up\n await pluginRuntime.destroy();\n }\n}\n\nconst envScript = (dev: boolean) => `// --- Environment Variables Loader ---\nconst $env = [${(dev ? devEnvFileArgs : prodEnvFileArgs).map((p) => `\"${p}\"`).join(', ')}];\nfor (const file of $env) {\n try {\n process.loadEnvFile(file);\n console.log('\\\\x1b[36m✔ Loaded \\\\x1b[0m\\\\x1b[33m%s\\\\x1b[0m', file);\n } catch {}\n}\n`;\n\nconst antiCrashScript = [\n '// --- CommandKit Anti-Crash Monitor ---',\n \" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process\",\n ' // instead of using it as a means to resume operation.',\n ' // But it exists here due to compatibility reasons with discord bot ecosystem.',\n \" const p = (t) => `\\\\x1b[31m${t}\\\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';\",\n ' if (!process.eventNames().includes(e1)) // skip if it is already handled',\n ' process.on(e1, (e) => {',\n ' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',\n ' })',\n ' if (!process.eventNames().includes(e2)) // skip if it is already handled',\n ' process.on(e2, (r) => {',\n ' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',\n ' });',\n '// --- CommandKit Anti-Crash Monitor ---',\n].join('\\n');\n\nconst wrapInAsyncIIFE = (code: string[]) =>\n `;await (async () => {\\n${code.join('\\n\\n')}\\n})();`;\n\nasync function injectEntryFile(\n configPath: string,\n isDev: boolean,\n emitAntiCrashScript: boolean,\n distDir?: string,\n) {\n const dist = isDev ? '.commandkit' : distDir || 'dist';\n const entryFilePath = join(configPath, dist, 'index.js');\n\n // skip if the entry file already exists\n if (existsSync(entryFilePath)) return;\n\n const code = `/* Entrypoint File Generated By CommandKit */\n${isDev ? `\\n\\n// Injected for development\\n${wrapInAsyncIIFE([envScript(isDev), emitAntiCrashScript ? antiCrashScript : ''])}\\n\\n` : wrapInAsyncIIFE([envScript(isDev)])}\n\nimport { commandkit } from 'commandkit';\nimport { Client } from 'discord.js';\n\nasync function bootstrap() {\n const app = await import('./app.js').then((m) => m.default ?? m);\n\n if (!app || !(app instanceof Client)) {\n throw new Error('The app file must default export the discord.js client instance');\n }\n\n commandkit.setClient(app);\n\n await commandkit.start();\n}\n\nawait bootstrap().catch((e) => {\n console.error('Failed to bootstrap CommandKit application:\\\\n', e.stack);\n})\n`;\n\n await writeFile(entryFilePath, code);\n}\n"],"mappings":"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"}
|
package/dist/cli/build.d.ts
CHANGED
package/dist/cli/build.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-DL3ucTiT.js');
|
|
2
2
|
require('../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
-
require('../commandkit-
|
|
4
|
+
require('../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-C6GtfAPW.js');
|
|
@@ -36,6 +36,6 @@ require('../CommandKitEventsChannel-BtRzr3Tz.js');
|
|
|
36
36
|
require('../store-CM6pWVZh.js');
|
|
37
37
|
require('../env-_68PRRoA.js');
|
|
38
38
|
require('../type-checker-ocNSZh0W.js');
|
|
39
|
-
const require_build = require('../build-
|
|
39
|
+
const require_build = require('../build-DB_aX5xt.js');
|
|
40
40
|
|
|
41
41
|
exports.buildApplication = require_build.buildApplication;
|
package/dist/cli/common.d.ts
CHANGED
package/dist/cli/development.js
CHANGED
|
@@ -2,7 +2,7 @@ const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
|
2
2
|
const require_colors = require('../colors-DL3ucTiT.js');
|
|
3
3
|
require('../ActionRow-CbdGFWMT.js');
|
|
4
4
|
require('../error-codes-Ds0bnPvT.js');
|
|
5
|
-
const require_commandkit = require('../commandkit-
|
|
5
|
+
const require_commandkit = require('../commandkit-lhbfAyX9.js');
|
|
6
6
|
require('../common-CcfjYnPG.js');
|
|
7
7
|
require('../common-vnMIelAE.js');
|
|
8
8
|
require('../container-C6GtfAPW.js');
|
|
@@ -38,7 +38,7 @@ require('../store-CM6pWVZh.js');
|
|
|
38
38
|
require('../env-_68PRRoA.js');
|
|
39
39
|
const require_app_process = require('../app-process-cj2vF12T.js');
|
|
40
40
|
require('../type-checker-ocNSZh0W.js');
|
|
41
|
-
const require_build = require('../build-
|
|
41
|
+
const require_build = require('../build-DB_aX5xt.js');
|
|
42
42
|
let node_crypto = require("node:crypto");
|
|
43
43
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
44
44
|
let path = require("path");
|
package/dist/cli/information.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
2
2
|
const require_constants = require('../constants-B5_Ta7PR.js');
|
|
3
|
-
const require_version = require('../version-
|
|
3
|
+
const require_version = require('../version-BCILNeQb.js');
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
node_fs = require_chunk.__toESM(node_fs);
|
|
6
6
|
let node_path = require("node:path");
|
package/dist/cli/init.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require('../colors-DL3ucTiT.js');
|
|
2
2
|
require('../ActionRow-CbdGFWMT.js');
|
|
3
3
|
require('../error-codes-Ds0bnPvT.js');
|
|
4
|
-
require('../commandkit-
|
|
4
|
+
require('../commandkit-lhbfAyX9.js');
|
|
5
5
|
require('../common-CcfjYnPG.js');
|
|
6
6
|
require('../common-vnMIelAE.js');
|
|
7
7
|
require('../container-C6GtfAPW.js');
|
|
@@ -34,6 +34,6 @@ require('../router-Dn35v30f.js');
|
|
|
34
34
|
require('../common-CrqwC-sx.js');
|
|
35
35
|
require('../CommandKitEventsChannel-BtRzr3Tz.js');
|
|
36
36
|
require('../store-CM6pWVZh.js');
|
|
37
|
-
const require_init = require('../init-
|
|
37
|
+
const require_init = require('../init-CY7OJPF-.js');
|
|
38
38
|
|
|
39
39
|
exports.bootstrapCommandkitCLI = require_init.bootstrapCommandkitCLI;
|
package/dist/cli/production.js
CHANGED
|
@@ -2,7 +2,7 @@ const require_chunk = require('../chunk-nOFOJqeH.js');
|
|
|
2
2
|
require('../colors-DL3ucTiT.js');
|
|
3
3
|
require('../ActionRow-CbdGFWMT.js');
|
|
4
4
|
require('../error-codes-Ds0bnPvT.js');
|
|
5
|
-
const require_commandkit = require('../commandkit-
|
|
5
|
+
const require_commandkit = require('../commandkit-lhbfAyX9.js');
|
|
6
6
|
require('../common-CcfjYnPG.js');
|
|
7
7
|
require('../common-vnMIelAE.js');
|
|
8
8
|
require('../container-C6GtfAPW.js');
|
|
@@ -38,7 +38,7 @@ require('../store-CM6pWVZh.js');
|
|
|
38
38
|
require('../env-_68PRRoA.js');
|
|
39
39
|
const require_app_process = require('../app-process-cj2vF12T.js');
|
|
40
40
|
require('../type-checker-ocNSZh0W.js');
|
|
41
|
-
const require_build = require('../build-
|
|
41
|
+
const require_build = require('../build-DB_aX5xt.js');
|
|
42
42
|
const require_utils$1 = require('../utils-DCSnVAZ6.js');
|
|
43
43
|
let fs = require("fs");
|
|
44
44
|
fs = require_chunk.__toESM(fs);
|
|
@@ -2733,14 +2733,11 @@ var CommandRegistrar = class {
|
|
|
2733
2733
|
return this.commandkit.commandHandler.getCommandsArray().flatMap((cmd) => {
|
|
2734
2734
|
const json = "toJSON" in cmd.data.command ? cmd.data.command.toJSON() : cmd.data.command;
|
|
2735
2735
|
const __metadata = cmd.metadata ?? cmd.data.metadata;
|
|
2736
|
-
const collections = [
|
|
2737
|
-
if (cmd.data.chatInput) collections.push({
|
|
2736
|
+
const collections = [{
|
|
2738
2737
|
...json,
|
|
2739
|
-
type: discord_js.ApplicationCommandType.ChatInput,
|
|
2740
|
-
description: json.description ?? "No command description set.",
|
|
2741
2738
|
__metadata
|
|
2742
|
-
}
|
|
2743
|
-
if (cmd.data.userContextMenu) {
|
|
2739
|
+
}];
|
|
2740
|
+
if (cmd.data.userContextMenu && json.type !== discord_js.ApplicationCommandType.User) {
|
|
2744
2741
|
var _metadata$nameAliases;
|
|
2745
2742
|
collections.push({
|
|
2746
2743
|
...json,
|
|
@@ -2752,7 +2749,7 @@ var CommandRegistrar = class {
|
|
|
2752
2749
|
__metadata
|
|
2753
2750
|
});
|
|
2754
2751
|
}
|
|
2755
|
-
if (cmd.data.messageContextMenu) {
|
|
2752
|
+
if (cmd.data.messageContextMenu && json.type !== discord_js.ApplicationCommandType.Message) {
|
|
2756
2753
|
var _metadata$nameAliases2;
|
|
2757
2754
|
collections.push({
|
|
2758
2755
|
...json,
|
|
@@ -3262,7 +3259,11 @@ var AppCommandHandler = class {
|
|
|
3262
3259
|
userPermissions: [],
|
|
3263
3260
|
botPermissions: []
|
|
3264
3261
|
},
|
|
3265
|
-
data: { command: {
|
|
3262
|
+
data: { command: {
|
|
3263
|
+
name: command.name,
|
|
3264
|
+
description: `${command.name} command`,
|
|
3265
|
+
type: 1
|
|
3266
|
+
} }
|
|
3266
3267
|
});
|
|
3267
3268
|
return;
|
|
3268
3269
|
}
|
|
@@ -3278,8 +3279,7 @@ var AppCommandHandler = class {
|
|
|
3278
3279
|
botPermissions: []
|
|
3279
3280
|
};
|
|
3280
3281
|
const commandName = commandFileData.command.name || command.name;
|
|
3281
|
-
|
|
3282
|
-
if (!commandDescription && commandFileData.chatInput) commandDescription = "No command description set.";
|
|
3282
|
+
const commandDescription = commandFileData.command.description || `${commandName} command`;
|
|
3283
3283
|
const updatedCommandData = {
|
|
3284
3284
|
...commandFileData.command,
|
|
3285
3285
|
name: commandName,
|
|
@@ -3877,6 +3877,7 @@ var CommandKit = class CommandKit extends node_events.default {
|
|
|
3877
3877
|
/**
|
|
3878
3878
|
* Create a new command and event handler with CommandKit.
|
|
3879
3879
|
* @param options - The default CommandKit configuration.
|
|
3880
|
+
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
3880
3881
|
*/
|
|
3881
3882
|
constructor(options = {}) {
|
|
3882
3883
|
if (CommandKit.instance) process.emitWarning("CommandKit instance already exists. Having multiple instance in same project is discouraged and it may lead to unexpected behavior.", { code: "MultiInstanceWarning" });
|
|
@@ -4481,4 +4482,4 @@ Object.defineProperty(exports, 'useStore', {
|
|
|
4481
4482
|
return useStore;
|
|
4482
4483
|
}
|
|
4483
4484
|
});
|
|
4484
|
-
//# sourceMappingURL=commandkit-
|
|
4485
|
+
//# sourceMappingURL=commandkit-lhbfAyX9.js.map
|