commandkit 0.1.11-dev.20250308073818 → 0.1.11-dev.20250308122630
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 +111 -199
- package/dist/index.js +317 -393
- package/dist/index.js.map +1 -1
- package/package.json +2 -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, PermissionsString, ChatInputCommandInteraction, ContextMenuCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, AutocompleteInteraction, ClientEvents, Awaitable, ButtonBuilder, ButtonInteraction, Events, ModalBuilder, ModalSubmitInteraction, ActionRowBuilder, TextInputBuilder, ButtonStyle, ComponentEmojiResolvable, TextInputStyle, Locale, Message as Message$1, ApplicationCommandOptionType, GuildMember, Attachment, User, Role, CommandInteractionOption, Collection, SlashCommandBuilder, ContextMenuCommandBuilder, PartialMessage } from 'discord.js';
|
|
2
|
+
import { RESTPostAPIApplicationCommandsJSONBody, Client, Interaction, CacheType, PermissionsString, ChatInputCommandInteraction, ContextMenuCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, AutocompleteInteraction, ClientEvents, Awaitable, ButtonBuilder, ButtonInteraction, Events, ModalBuilder, ModalSubmitInteraction, ActionRowBuilder, TextInputBuilder, ButtonStyle, ComponentEmojiResolvable, TextInputStyle, LocalizationMap, Locale, Message as Message$1, ApplicationCommandOptionType, GuildMember, Attachment, User, Role, CommandInteractionOption, 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';
|
|
@@ -576,6 +576,11 @@ interface TranslatableCommandOptions {
|
|
|
576
576
|
ref: string;
|
|
577
577
|
name?: string;
|
|
578
578
|
description?: string;
|
|
579
|
+
options?: TranslatableCommandOptions[];
|
|
580
|
+
}
|
|
581
|
+
interface ApiTranslatableCommandOptions extends TranslatableCommandOptions {
|
|
582
|
+
name_localizations?: LocalizationMap;
|
|
583
|
+
description_localizations?: LocalizationMap;
|
|
579
584
|
}
|
|
580
585
|
interface Translation {
|
|
581
586
|
command: TranslatableCommand;
|
|
@@ -842,7 +847,7 @@ declare const CommandExecutionMode: {
|
|
|
842
847
|
readonly Message: "message";
|
|
843
848
|
};
|
|
844
849
|
type CommandExecutionMode = (typeof CommandExecutionMode)[keyof typeof CommandExecutionMode];
|
|
845
|
-
interface ContextParameters<T extends CommandExecutionMode
|
|
850
|
+
interface ContextParameters<T extends CommandExecutionMode, Args = Record<string, any>> {
|
|
846
851
|
environment?: CommandKitEnvironment;
|
|
847
852
|
executionMode: T;
|
|
848
853
|
interaction: T extends 'chatInput' ? ChatInputCommandInteraction : T extends 'messageContextMenu' ? MessageContextMenuCommandInteraction : T extends 'userContextMenu' ? UserContextMenuCommandInteraction : T extends 'autocomplete' ? AutocompleteInteraction : never;
|
|
@@ -850,6 +855,7 @@ interface ContextParameters<T extends CommandExecutionMode> {
|
|
|
850
855
|
forwarded?: boolean;
|
|
851
856
|
messageCommandParser?: T extends 'message' ? MessageCommandParser : never;
|
|
852
857
|
store?: Map<string, any>;
|
|
858
|
+
customArgs?: Args;
|
|
853
859
|
}
|
|
854
860
|
type MessageCommandContext = Context<'message'>;
|
|
855
861
|
type InteractionCommandContext = Context<'autocomplete' | 'chatInput' | 'messageContextMenu' | 'userContextMenu'>;
|
|
@@ -870,10 +876,13 @@ type AutocompleteCommand = AnyCommandExecute<AutocompleteCommandContext>;
|
|
|
870
876
|
type MessageContextMenuCommand = AnyCommandExecute<MessageContextMenuCommandContext>;
|
|
871
877
|
type UserContextMenuCommand = AnyCommandExecute<UserContextMenuCommandContext>;
|
|
872
878
|
type MessageCommand = AnyCommandExecute<MessageCommandContext>;
|
|
873
|
-
|
|
879
|
+
interface MiddlewareContextArgs {
|
|
880
|
+
setCommandRunner?: GenericFunction<[RunCommand]>;
|
|
881
|
+
}
|
|
882
|
+
declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecutionMode, Args extends Record<string, any> = Record<string, any>> {
|
|
874
883
|
#private;
|
|
875
884
|
readonly commandkit: CommandKit;
|
|
876
|
-
|
|
885
|
+
protected readonly config: ContextParameters<ExecutionMode, Args>;
|
|
877
886
|
/**
|
|
878
887
|
* The interaction that triggered the command.
|
|
879
888
|
*/
|
|
@@ -892,7 +901,7 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
892
901
|
* @param commandkit The command kit instance.
|
|
893
902
|
* @param config The context parameters.
|
|
894
903
|
*/
|
|
895
|
-
constructor(commandkit: CommandKit, config: ContextParameters<ExecutionMode>);
|
|
904
|
+
constructor(commandkit: CommandKit, config: ContextParameters<ExecutionMode, Args>);
|
|
896
905
|
/**
|
|
897
906
|
* The shared key-value store for this context. This can be used to store data that needs to be shared between middlewares or commands.
|
|
898
907
|
* This store is shared across all contexts in the same command execution, including the cloned contexts and middleware contexts.
|
|
@@ -995,7 +1004,7 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
995
1004
|
*/
|
|
996
1005
|
isCached(fn: GenericFunction): boolean;
|
|
997
1006
|
}
|
|
998
|
-
declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutionMode> extends Context<T> {
|
|
1007
|
+
declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutionMode> extends Context<T, MiddlewareContextArgs> {
|
|
999
1008
|
#private;
|
|
1000
1009
|
/**
|
|
1001
1010
|
* Whether the command execution was cancelled.
|
|
@@ -1005,167 +1014,69 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
|
|
|
1005
1014
|
* Cancels the command execution.
|
|
1006
1015
|
*/
|
|
1007
1016
|
cancel(): void;
|
|
1017
|
+
/**
|
|
1018
|
+
* Sets command runner function to wrap the command execution.
|
|
1019
|
+
* @param fn The function to set.
|
|
1020
|
+
* @example ctx.setCommandRunner(async (execute) => {
|
|
1021
|
+
* // do something before command execution
|
|
1022
|
+
* await execute();
|
|
1023
|
+
* // do something after command execution
|
|
1024
|
+
* })
|
|
1025
|
+
*/
|
|
1026
|
+
setCommandRunner(fn: RunCommand): void;
|
|
1008
1027
|
}
|
|
1009
1028
|
|
|
1010
|
-
/**
|
|
1011
|
-
* Represents a command file info parsed from the file system.
|
|
1012
|
-
* It does not contain any command specific data, as that's loaded later by the command handler.
|
|
1013
|
-
*/
|
|
1014
1029
|
interface ParsedCommand {
|
|
1015
|
-
/**
|
|
1016
|
-
* The unique identifier of the command. This is used to distinguish between commands that may have the same name.
|
|
1017
|
-
*/
|
|
1018
1030
|
id: string;
|
|
1019
|
-
/**
|
|
1020
|
-
* The file name of the command.
|
|
1021
|
-
*/
|
|
1022
1031
|
name: string;
|
|
1023
|
-
/**
|
|
1024
|
-
* The absolute path to the command file.
|
|
1025
|
-
*/
|
|
1026
1032
|
path: string;
|
|
1027
|
-
/**
|
|
1028
|
-
* The relative path from the cwd to the command file.
|
|
1029
|
-
*/
|
|
1030
1033
|
relativePath: string;
|
|
1031
|
-
/**
|
|
1032
|
-
* The category of this command. This will be the parent directory segment that matches /(category)/ in the path.
|
|
1033
|
-
* When there are multiple segments, they are combined with a colon.
|
|
1034
|
-
* Example: `/commands/(games)/tictactoe.js` -> category is `games`
|
|
1035
|
-
* Example: `/commands/(games)/(fun)/tictactoe.js` -> category is `games:fun`
|
|
1036
|
-
* Category is `null` if the parent directory segment does not match `/(\w+)/`.
|
|
1037
|
-
*/
|
|
1038
1034
|
category: string | null;
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
*/
|
|
1042
|
-
middlewares: string[];
|
|
1043
|
-
/**
|
|
1044
|
-
* Array of ids referencing the associated subcommands for this command.
|
|
1045
|
-
*/
|
|
1046
|
-
subcommands: string[];
|
|
1035
|
+
subcommands: ParsedSubCommand[];
|
|
1036
|
+
middlewareIds: string[];
|
|
1047
1037
|
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Represents a middleware file info parsed from the file system.
|
|
1050
|
-
*/
|
|
1051
1038
|
interface ParsedMiddleware {
|
|
1052
|
-
/**
|
|
1053
|
-
* The unique identifier of the middleware. This is used to distinguish between middlewares that may have the same name.
|
|
1054
|
-
*/
|
|
1055
1039
|
id: string;
|
|
1056
|
-
/**
|
|
1057
|
-
* The file name of the middleware.
|
|
1058
|
-
*/
|
|
1059
|
-
name: string;
|
|
1060
|
-
/**
|
|
1061
|
-
* The absolute path to the middleware file.
|
|
1062
|
-
*/
|
|
1063
1040
|
path: string;
|
|
1064
|
-
/**
|
|
1065
|
-
* The relative path from the cwd to the middleware file.
|
|
1066
|
-
*/
|
|
1067
1041
|
relativePath: string;
|
|
1068
|
-
/**
|
|
1069
|
-
* The category of this middleware. This will be the parent directory segment that matches /(category)/ in the path.
|
|
1070
|
-
*/
|
|
1071
|
-
category: string | null;
|
|
1072
1042
|
}
|
|
1073
|
-
/**
|
|
1074
|
-
* Represents a subcommand file info parsed from the file system.
|
|
1075
|
-
*/
|
|
1076
1043
|
interface ParsedSubCommand {
|
|
1077
|
-
/**
|
|
1078
|
-
* The unique identifier of the subcommand. This is used to distinguish between subcommands that may have the same name.
|
|
1079
|
-
*/
|
|
1080
|
-
id: string;
|
|
1081
|
-
/**
|
|
1082
|
-
* The name of the subcommand.
|
|
1083
|
-
*/
|
|
1084
1044
|
name: string;
|
|
1085
|
-
/**
|
|
1086
|
-
* The group name of the subcommand. This is used to group subcommands together in the Discord UI.
|
|
1087
|
-
*/
|
|
1088
1045
|
group: string | null;
|
|
1089
|
-
/**
|
|
1090
|
-
* The category of this subcommand. This will be the parent directory segment that matches /(category)/ in the path.
|
|
1091
|
-
*/
|
|
1092
|
-
category: string | null;
|
|
1093
|
-
/**
|
|
1094
|
-
* The absolute path to the subcommand file.
|
|
1095
|
-
*/
|
|
1096
1046
|
path: string;
|
|
1097
|
-
/**
|
|
1098
|
-
* The relative path from the cwd to the subcommand file.
|
|
1099
|
-
*/
|
|
1100
1047
|
relativePath: string;
|
|
1101
|
-
|
|
1102
|
-
* Array of ids referencing the associated middleware for this subcommand.
|
|
1103
|
-
*/
|
|
1104
|
-
middlewares: string[];
|
|
1048
|
+
command: string;
|
|
1105
1049
|
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
*/
|
|
1109
|
-
interface CommandTree {
|
|
1110
|
-
commands: Record<string, ParsedCommand>;
|
|
1111
|
-
middlewares: Record<string, ParsedMiddleware>;
|
|
1112
|
-
subcommands: Record<string, ParsedSubCommand>;
|
|
1050
|
+
interface CommandsRouterOptions {
|
|
1051
|
+
entrypoint: string;
|
|
1113
1052
|
}
|
|
1114
|
-
|
|
1115
|
-
* Represents the scanned and parsed command files.
|
|
1116
|
-
*/
|
|
1117
|
-
interface ParsedCommandData {
|
|
1053
|
+
interface CommandsRouterData {
|
|
1118
1054
|
commands: Collection<string, ParsedCommand>;
|
|
1119
1055
|
middlewares: Collection<string, ParsedMiddleware>;
|
|
1120
|
-
subcommands: Collection<string, ParsedSubCommand>;
|
|
1121
1056
|
}
|
|
1122
|
-
interface
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
*/
|
|
1126
|
-
entrypoint: string;
|
|
1057
|
+
interface CommandsRouterRawData {
|
|
1058
|
+
commands: Record<string, ParsedCommand>;
|
|
1059
|
+
middlewares: Record<string, ParsedMiddleware>;
|
|
1127
1060
|
}
|
|
1128
1061
|
declare class CommandsRouter {
|
|
1129
|
-
private options;
|
|
1062
|
+
private readonly options;
|
|
1130
1063
|
private commands;
|
|
1131
1064
|
private middlewares;
|
|
1132
|
-
private subcommands;
|
|
1133
1065
|
constructor(options: CommandsRouterOptions);
|
|
1066
|
+
fromData(data: CommandsRouterRawData): void;
|
|
1134
1067
|
isValidPath(): boolean;
|
|
1135
|
-
|
|
1068
|
+
getData(): CommandsRouterData;
|
|
1069
|
+
toJSON(): CommandsRouterRawData;
|
|
1136
1070
|
clear(): void;
|
|
1137
|
-
reload(): Promise<
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
private
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
*/
|
|
1147
|
-
private getPathSegmentsBetween;
|
|
1148
|
-
private processMiddleware;
|
|
1149
|
-
private processSubcommand;
|
|
1150
|
-
private processCommand;
|
|
1151
|
-
private extractDirOmitCategory;
|
|
1152
|
-
/**
|
|
1153
|
-
* Gets the appropriate file name, handling index files specially
|
|
1154
|
-
* For index files, it returns the parent directory name (excluding category markers)
|
|
1155
|
-
*/
|
|
1156
|
-
private getAppropriateFileName;
|
|
1157
|
-
/**
|
|
1158
|
-
* Extract the clean directory name, removing any category markers
|
|
1159
|
-
*/
|
|
1160
|
-
private getDirectoryName;
|
|
1161
|
-
private isCategoryDirectory;
|
|
1162
|
-
private applyMiddlewareToCommands;
|
|
1163
|
-
private applySubcommandToCommands;
|
|
1164
|
-
private extractCategory;
|
|
1165
|
-
private getRelativePath;
|
|
1166
|
-
private isMiddleware;
|
|
1167
|
-
private shouldIgnore;
|
|
1168
|
-
private extractName;
|
|
1071
|
+
reload(): Promise<CommandsRouterRawData>;
|
|
1072
|
+
scan(): Promise<CommandsRouterRawData>;
|
|
1073
|
+
private traverse;
|
|
1074
|
+
private applyBindings;
|
|
1075
|
+
private distanceFromRoot;
|
|
1076
|
+
private parseGroup;
|
|
1077
|
+
private parseCategory;
|
|
1078
|
+
private parseFileName;
|
|
1079
|
+
private toRelativePath;
|
|
1169
1080
|
}
|
|
1170
1081
|
|
|
1171
1082
|
/**
|
|
@@ -1280,68 +1191,6 @@ declare class CommandRegistrar {
|
|
|
1280
1191
|
updateGuildCommands(commands: CommandData[]): Promise<void>;
|
|
1281
1192
|
}
|
|
1282
1193
|
|
|
1283
|
-
interface AppCommand {
|
|
1284
|
-
command: SlashCommandBuilder | Record<string, any>;
|
|
1285
|
-
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
1286
|
-
autocomplete?: (ctx: Context) => Awaitable<unknown>;
|
|
1287
|
-
message?: (ctx: Context) => Awaitable<unknown>;
|
|
1288
|
-
messageContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1289
|
-
userContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1290
|
-
}
|
|
1291
|
-
interface AppCommandMiddleware {
|
|
1292
|
-
beforeExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1293
|
-
afterExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1294
|
-
}
|
|
1295
|
-
interface LoadedCommand {
|
|
1296
|
-
command: ParsedCommand;
|
|
1297
|
-
data: AppCommand;
|
|
1298
|
-
subcommands?: ParsedSubCommand[];
|
|
1299
|
-
guilds?: string[];
|
|
1300
|
-
}
|
|
1301
|
-
interface LoadedMiddleware {
|
|
1302
|
-
middleware: ParsedMiddleware;
|
|
1303
|
-
data: AppCommandMiddleware;
|
|
1304
|
-
}
|
|
1305
|
-
interface PreparedAppCommandExecution {
|
|
1306
|
-
command: LoadedCommand;
|
|
1307
|
-
subcommand?: LoadedSubCommand | null;
|
|
1308
|
-
middlewares: LoadedMiddleware[];
|
|
1309
|
-
messageCommandParser?: MessageCommandParser;
|
|
1310
|
-
}
|
|
1311
|
-
interface LoadedSubCommand {
|
|
1312
|
-
subcommand: ParsedSubCommand;
|
|
1313
|
-
data: AppCommand;
|
|
1314
|
-
}
|
|
1315
|
-
type CommandBuilderLike = SlashCommandBuilder | ContextMenuCommandBuilder | Record<string, any>;
|
|
1316
|
-
declare class AppCommandHandler {
|
|
1317
|
-
readonly commandkit: CommandKit;
|
|
1318
|
-
private loadedCommands;
|
|
1319
|
-
private loadedSubCommands;
|
|
1320
|
-
private loadedMiddlewares;
|
|
1321
|
-
private commandNameToId;
|
|
1322
|
-
private subcommandPathToId;
|
|
1323
|
-
readonly registrar: CommandRegistrar;
|
|
1324
|
-
private onInteraction;
|
|
1325
|
-
private onMessageCreate;
|
|
1326
|
-
private onMessageUpdate;
|
|
1327
|
-
constructor(commandkit: CommandKit);
|
|
1328
|
-
getCommandsArray(): LoadedCommand[];
|
|
1329
|
-
/**
|
|
1330
|
-
* Get subcommand data by ID for the command registrar
|
|
1331
|
-
*/
|
|
1332
|
-
getSubcommandData(id: string): any;
|
|
1333
|
-
registerCommandHandler(): void;
|
|
1334
|
-
getExecutionMode(source: Interaction | Message$1): CommandExecutionMode;
|
|
1335
|
-
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message$1): Promise<void>;
|
|
1336
|
-
prepareCommandRun(source: Interaction | Message$1): Promise<PreparedAppCommandExecution | null>;
|
|
1337
|
-
reloadCommands(): Promise<void>;
|
|
1338
|
-
loadCommands(): Promise<void>;
|
|
1339
|
-
private loadMiddleware;
|
|
1340
|
-
private loadCommand;
|
|
1341
|
-
private loadSubcommand;
|
|
1342
|
-
applyLocalizations(command: CommandBuilderLike): Promise<discord_js.RESTPostAPIContextMenuApplicationCommandsJSONBody | CommandBuilderLike>;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
1194
|
declare class MemoryCache extends CacheProvider {
|
|
1346
1195
|
#private;
|
|
1347
1196
|
get<T>(key: string): Promise<CacheEntry<T> | undefined>;
|
|
@@ -1470,6 +1319,69 @@ declare function revalidate<T = unknown>(tag: string, ...args: any[]): Promise<T
|
|
|
1470
1319
|
*/
|
|
1471
1320
|
declare function isCachedFunction(fn: GenericFunction): boolean;
|
|
1472
1321
|
|
|
1322
|
+
type RunCommand = <T extends AsyncFunction>(fn: T) => T;
|
|
1323
|
+
interface AppCommand {
|
|
1324
|
+
command: SlashCommandBuilder | Record<string, any>;
|
|
1325
|
+
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
1326
|
+
autocomplete?: (ctx: Context) => Awaitable<unknown>;
|
|
1327
|
+
message?: (ctx: Context) => Awaitable<unknown>;
|
|
1328
|
+
messageContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1329
|
+
userContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1330
|
+
}
|
|
1331
|
+
interface AppCommandMiddleware {
|
|
1332
|
+
beforeExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1333
|
+
afterExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1334
|
+
}
|
|
1335
|
+
interface LoadedCommand {
|
|
1336
|
+
command: ParsedCommand;
|
|
1337
|
+
data: AppCommand;
|
|
1338
|
+
subcommands?: ParsedSubCommand[];
|
|
1339
|
+
guilds?: string[];
|
|
1340
|
+
}
|
|
1341
|
+
interface LoadedMiddleware {
|
|
1342
|
+
middleware: ParsedMiddleware;
|
|
1343
|
+
data: AppCommandMiddleware;
|
|
1344
|
+
}
|
|
1345
|
+
interface PreparedAppCommandExecution {
|
|
1346
|
+
command: LoadedCommand;
|
|
1347
|
+
subcommand?: LoadedSubCommand | null;
|
|
1348
|
+
middlewares: LoadedMiddleware[];
|
|
1349
|
+
messageCommandParser?: MessageCommandParser;
|
|
1350
|
+
}
|
|
1351
|
+
interface LoadedSubCommand {
|
|
1352
|
+
subcommand: ParsedSubCommand;
|
|
1353
|
+
data: AppCommand;
|
|
1354
|
+
}
|
|
1355
|
+
type CommandBuilderLike = SlashCommandBuilder | ContextMenuCommandBuilder | Record<string, any>;
|
|
1356
|
+
declare class AppCommandHandler {
|
|
1357
|
+
readonly commandkit: CommandKit;
|
|
1358
|
+
private loadedCommands;
|
|
1359
|
+
private loadedSubCommands;
|
|
1360
|
+
private loadedMiddlewares;
|
|
1361
|
+
private commandNameToId;
|
|
1362
|
+
private subcommandPathToId;
|
|
1363
|
+
readonly registrar: CommandRegistrar;
|
|
1364
|
+
private onInteraction;
|
|
1365
|
+
private onMessageCreate;
|
|
1366
|
+
private onMessageUpdate;
|
|
1367
|
+
constructor(commandkit: CommandKit);
|
|
1368
|
+
getCommandsArray(): LoadedCommand[];
|
|
1369
|
+
/**
|
|
1370
|
+
* Get subcommand data by command ID and subcommand name
|
|
1371
|
+
*/
|
|
1372
|
+
getSubcommandData(commandId: string, subcommandName: string): any;
|
|
1373
|
+
registerCommandHandler(): void;
|
|
1374
|
+
getExecutionMode(source: Interaction | Message$1): CommandExecutionMode;
|
|
1375
|
+
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message$1): Promise<void>;
|
|
1376
|
+
prepareCommandRun(source: Interaction | Message$1): Promise<PreparedAppCommandExecution | null>;
|
|
1377
|
+
reloadCommands(): Promise<void>;
|
|
1378
|
+
loadCommands(): Promise<void>;
|
|
1379
|
+
private loadMiddleware;
|
|
1380
|
+
private loadCommand;
|
|
1381
|
+
private loadSubcommand;
|
|
1382
|
+
applyLocalizations(command: CommandBuilderLike, subcommand?: ParsedSubCommand): Promise<CommandBuilderLike>;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1473
1385
|
type ListenerFunction = GenericFunction | AsyncFunction;
|
|
1474
1386
|
declare class CommandKitEventsChannel {
|
|
1475
1387
|
readonly commandkit: CommandKit;
|
|
@@ -2013,4 +1925,4 @@ declare const version: string;
|
|
|
2013
1925
|
*/
|
|
2014
1926
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
2015
1927
|
|
|
2016
|
-
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type AutocompleteProps, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, type CommandFileObject, 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 CommandObject, type CommandOptions, type CommandProps, type
|
|
1928
|
+
export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, type ApiTranslatableCommandOptions, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type AutocompleteProps, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, type CommandFileObject, 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 CommandObject, type CommandOptions, type CommandProps, CommandsRouter, type CommandsRouterData, type CommandsRouterOptions, type CommandsRouterRawData, Context, type ContextMenuCommandProps, 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, Localization, type LocalizationConfig, type LocalizationStrategy, type LocalizationTranslationRequest, Logger, type LoggerImpl, type MaybeArray, MemoryCache, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type MessageContextMenuCommandProps, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnModalKitEnd, type OnModalKitSubmit, ParagraphInput, type ParsedCommand, type ParsedEvent, type ParsedMessageCommand, type ParsedMiddleware, type ParsedSubCommand, type PreparedAppCommandExecution, type ReloadOptions, ReloadType, type RunCommand, ShortInput, type SlashCommand, type SlashCommandContext, type SlashCommandMiddlewareContext, type SlashCommandProps, TextInput, type TextInputProps, type TranslatableArguments, type TranslatableCommand, type TranslatableCommandOptions, type Translation, type TranslationResult, type Translator, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, type UserContextMenuCommandProps, type ValidationProps, afterCommand, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfterCommand, createElement, createLogger, CommandKit as default, defineConfig, dmOnly, exitContext, exitMiddleware, getCommandKit, getConfig, getContext, getElement, guildOnly, invalidate, isCachedFunction, isCommandKitElement, makeContextAwareFunction, 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 };
|