commandkit 0.1.11-dev.20250330115232 → 0.1.11-dev.20250330125518
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.d.ts +12 -2
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
|
-
import { RESTPostAPIApplicationCommandsJSONBody, Client, Interaction, CacheType, ClientEvents, Awaitable, ButtonBuilder, ButtonInteraction, Events, ModalBuilder, ModalSubmitInteraction, ActionRowBuilder, TextInputBuilder, ButtonStyle, ComponentEmojiResolvable, TextInputStyle, StringSelectMenuBuilder,
|
|
2
|
+
import { RESTPostAPIApplicationCommandsJSONBody, Client, Interaction, CacheType, ClientEvents, Awaitable, ButtonBuilder, ButtonInteraction, Events, ModalBuilder, ModalSubmitInteraction, ActionRowBuilder, TextInputBuilder, ButtonStyle, ComponentEmojiResolvable, TextInputStyle, StringSelectMenuInteraction, StringSelectMenuBuilder, ChannelSelectMenuInteraction, ChannelSelectMenuBuilder, MentionableSelectMenuInteraction, MentionableSelectMenuBuilder, UserSelectMenuInteraction, UserSelectMenuBuilder, RoleSelectMenuInteraction, RoleSelectMenuBuilder, BaseSelectMenuComponentData, StringSelectMenuOptionBuilder, SelectMenuComponentOptionData, APISelectMenuOption, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, LocalizationMap, Locale, Message as Message$1, ApplicationCommandOptionType, GuildMember, Attachment, User, Role, CommandInteractionOption, ChatInputCommandInteraction, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, AutocompleteInteraction, Collection, SlashCommandBuilder, ContextMenuCommandBuilder, PartialMessage } from 'discord.js';
|
|
3
3
|
import EventEmitter from 'node:events';
|
|
4
4
|
import { Channel } from 'diagnostics_channel';
|
|
5
5
|
import * as commander from 'commander';
|
|
@@ -380,6 +380,8 @@ type CommandKitSelectMenuBuilderInteractionCollectorDispatch<T, C> = (interactio
|
|
|
380
380
|
type CommandKitSelectMenuBuilderOnEnd = (reason: string) => Awaitable<void>;
|
|
381
381
|
type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData = EventInterceptorContextData<Events.InteractionCreate>;
|
|
382
382
|
|
|
383
|
+
type OnStringSelectMenuKitSubmit = OnSelectMenuKitSubmit<StringSelectMenuInteraction, StringSelectMenuKit>;
|
|
384
|
+
type StringSelectMenuKitPredicate = SelectMenuKitPredicate<StringSelectMenuInteraction>;
|
|
383
385
|
declare class StringSelectMenuKit extends StringSelectMenuBuilder {
|
|
384
386
|
#private;
|
|
385
387
|
/**
|
|
@@ -422,6 +424,8 @@ declare class StringSelectMenuKit extends StringSelectMenuBuilder {
|
|
|
422
424
|
dispose(): this;
|
|
423
425
|
}
|
|
424
426
|
|
|
427
|
+
type OnChannelSelectMenuKitSubmit = OnSelectMenuKitSubmit<ChannelSelectMenuInteraction, ChannelSelectMenuKit>;
|
|
428
|
+
type ChannelSelectMenuKitPredicate = SelectMenuKitPredicate<ChannelSelectMenuInteraction>;
|
|
425
429
|
declare class ChannelSelectMenuKit extends ChannelSelectMenuBuilder {
|
|
426
430
|
#private;
|
|
427
431
|
/**
|
|
@@ -464,6 +468,8 @@ declare class ChannelSelectMenuKit extends ChannelSelectMenuBuilder {
|
|
|
464
468
|
dispose(): this;
|
|
465
469
|
}
|
|
466
470
|
|
|
471
|
+
type OnMentionableSelectMenuKitSubmit = OnSelectMenuKitSubmit<MentionableSelectMenuInteraction, MentionableSelectMenuKit>;
|
|
472
|
+
type MentionableSelectMenuKitPredicate = SelectMenuKitPredicate<MentionableSelectMenuInteraction>;
|
|
467
473
|
declare class MentionableSelectMenuKit extends MentionableSelectMenuBuilder {
|
|
468
474
|
#private;
|
|
469
475
|
/**
|
|
@@ -506,6 +512,8 @@ declare class MentionableSelectMenuKit extends MentionableSelectMenuBuilder {
|
|
|
506
512
|
dispose(): this;
|
|
507
513
|
}
|
|
508
514
|
|
|
515
|
+
type OnUserSelectMenuKitSubmit = OnSelectMenuKitSubmit<UserSelectMenuInteraction, UserSelectMenuKit>;
|
|
516
|
+
type UserSelectMenuKitPredicate = SelectMenuKitPredicate<UserSelectMenuInteraction>;
|
|
509
517
|
declare class UserSelectMenuKit extends UserSelectMenuBuilder {
|
|
510
518
|
#private;
|
|
511
519
|
/**
|
|
@@ -548,6 +556,8 @@ declare class UserSelectMenuKit extends UserSelectMenuBuilder {
|
|
|
548
556
|
dispose(): this;
|
|
549
557
|
}
|
|
550
558
|
|
|
559
|
+
type OnRoleSelectMenuKitSubmit = OnSelectMenuKitSubmit<RoleSelectMenuInteraction, RoleSelectMenuKit>;
|
|
560
|
+
type RoleSelectMenuKitPredicate = SelectMenuKitPredicate<RoleSelectMenuInteraction>;
|
|
551
561
|
declare class RoleSelectMenuKit extends RoleSelectMenuBuilder {
|
|
552
562
|
#private;
|
|
553
563
|
/**
|
|
@@ -1955,4 +1965,4 @@ declare const version: string;
|
|
|
1955
1965
|
*/
|
|
1956
1966
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
1957
1967
|
|
|
1958
|
-
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, type ApiTranslatableCommandOptions, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuProps, type Command, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, type CommandLocalizationTypeData, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Context, type ContextParameters, DefaultLocalizationStrategy, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, Fragment, type FragmentElementProps, type GenericFunction, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, Localization, type LocalizationConfig, type LocalizationStrategy, type LocalizationTranslationRequest, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, type SelectMenuKitPredicate, type SelectMenuProps, type Setup, ShortInput, type SlashCommand, type SlashCommandContext, type SlashCommandMiddlewareContext, StringSelectMenu, StringSelectMenuKit, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextInput, type TextInputProps, type TransformedResult, type TranslatableArguments, type TranslatableCommand, type TranslatableCommandName, type TranslatableCommandOptions, type Translation, type TranslationResult, type Translator, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuProps, afterCommand, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfterCommand, commandkit, createElement, createLogger, CommandKit as default, defineConfig, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getElement, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, provideContext, redirect, rethrow, revalidate, useCache as super_duper_secret_internal_for_use_cache_directive_of_commandkit_cli_do_not_use_it_directly_or_you_will_be_fired_from_your_job_kthxbai, useEnvironment, version };
|
|
1968
|
+
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, type ApiTranslatableCommandOptions, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type Command, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, type CommandLocalizationTypeData, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Context, type ContextParameters, DefaultLocalizationStrategy, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, Fragment, type FragmentElementProps, type GenericFunction, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, Localization, type LocalizationConfig, type LocalizationStrategy, type LocalizationTranslationRequest, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, type SelectMenuKitPredicate, type SelectMenuProps, type Setup, ShortInput, type SlashCommand, type SlashCommandContext, type SlashCommandMiddlewareContext, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextInput, type TextInputProps, type TransformedResult, type TranslatableArguments, type TranslatableCommand, type TranslatableCommandName, type TranslatableCommandOptions, type Translation, type TranslationResult, type Translator, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, afterCommand, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfterCommand, commandkit, createElement, createLogger, CommandKit as default, defineConfig, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getElement, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, provideContext, redirect, rethrow, revalidate, useCache as super_duper_secret_internal_for_use_cache_directive_of_commandkit_cli_do_not_use_it_directly_or_you_will_be_fired_from_your_job_kthxbai, useEnvironment, version };
|
package/dist/index.js
CHANGED
|
@@ -5633,7 +5633,7 @@ var init_version = __esm({
|
|
|
5633
5633
|
"use strict";
|
|
5634
5634
|
init_cjs_shims();
|
|
5635
5635
|
version = /* @__MACRO__ $version */
|
|
5636
|
-
"0.1.11-dev.
|
|
5636
|
+
"0.1.11-dev.20250330125518";
|
|
5637
5637
|
}
|
|
5638
5638
|
});
|
|
5639
5639
|
|
|
@@ -6061,10 +6061,14 @@ __export(generators_exports, {
|
|
|
6061
6061
|
generateEvent: () => generateEvent,
|
|
6062
6062
|
generateLocale: () => generateLocale
|
|
6063
6063
|
});
|
|
6064
|
+
function determineExtension() {
|
|
6065
|
+
return (0, import_fs2.existsSync)((0, import_path4.join)(BASE_PATH, "tsconfig.json")) ? "ts" : "js";
|
|
6066
|
+
}
|
|
6064
6067
|
async function generateCommand(name, customPath) {
|
|
6065
|
-
const cmdPath = (0, import_path4.join)(customPath || COMMANDS_DIR
|
|
6068
|
+
const cmdPath = (0, import_path4.join)(customPath || COMMANDS_DIR);
|
|
6066
6069
|
if (!(0, import_fs2.existsSync)(cmdPath)) await (0, import_promises7.mkdir)(cmdPath, { recursive: true });
|
|
6067
|
-
|
|
6070
|
+
const fileName = `${name}.${determineExtension()}`;
|
|
6071
|
+
if ((0, import_fs2.existsSync)((0, import_path4.join)(cmdPath, fileName))) {
|
|
6068
6072
|
panic(`Command ${name} already exists.`);
|
|
6069
6073
|
}
|
|
6070
6074
|
const commandFile = `
|
|
@@ -6083,10 +6087,10 @@ export const message: MessageCommand = async (ctx) => {
|
|
|
6083
6087
|
await ctx.message.reply('Hello from ${name}!');
|
|
6084
6088
|
};
|
|
6085
6089
|
`.trim();
|
|
6086
|
-
await (0, import_promises7.writeFile)((0, import_path4.join)(cmdPath,
|
|
6090
|
+
await (0, import_promises7.writeFile)((0, import_path4.join)(cmdPath, fileName), commandFile);
|
|
6087
6091
|
console.log(
|
|
6088
6092
|
colors_default.green(
|
|
6089
|
-
`Command ${colors_default.magenta(name)} created at ${colors_default.blue(formatPath(cmdPath))}
|
|
6093
|
+
`Command ${colors_default.magenta(name)} created at ${colors_default.blue(formatPath(`${cmdPath}/${fileName}`))}`
|
|
6090
6094
|
)
|
|
6091
6095
|
);
|
|
6092
6096
|
}
|
|
@@ -6160,6 +6164,7 @@ var init_generators = __esm({
|
|
|
6160
6164
|
EVENTS_DIR = (0, import_path4.join)(BASE_PATH, "src/app/events");
|
|
6161
6165
|
LOCALES_DIR = (0, import_path4.join)(BASE_PATH, "src/app/locales");
|
|
6162
6166
|
formatPath = /* @__PURE__ */ __name((path2) => path2.replace(process.cwd(), ".").replace(/\\/g, "/"), "formatPath");
|
|
6167
|
+
__name(determineExtension, "determineExtension");
|
|
6163
6168
|
__name(generateCommand, "generateCommand");
|
|
6164
6169
|
__name(generateEvent, "generateEvent");
|
|
6165
6170
|
__name(generateLocale, "generateLocale");
|