commandkit 0.1.11-dev.20250216145024 → 0.1.11-dev.20250306152436
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/bin/index.mjs +1 -1
- package/dist/index.d.ts +690 -505
- package/dist/index.js +5277 -33
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/dist/index.d.mts +0 -1770
- package/dist/index.mjs +0 -50
- package/dist/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
|
-
import { Client, Interaction, CacheType, ChatInputCommandInteraction, ContextMenuCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, AutocompleteInteraction,
|
|
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';
|
|
3
3
|
import EventEmitter from 'node:events';
|
|
4
4
|
import { Channel } from 'diagnostics_channel';
|
|
5
5
|
import * as commander from 'commander';
|
|
@@ -67,14 +67,6 @@ interface CommandKitOptions {
|
|
|
67
67
|
*/
|
|
68
68
|
cacheProvider?: CacheProvider | null;
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Private data for the CommandKit class.
|
|
72
|
-
*/
|
|
73
|
-
interface CommandKitData extends CommandKitOptions {
|
|
74
|
-
commandHandler?: CommandHandler;
|
|
75
|
-
eventHandler?: EventHandler;
|
|
76
|
-
validationHandler?: ValidationHandler;
|
|
77
|
-
}
|
|
78
70
|
/**
|
|
79
71
|
* Represents a command context.
|
|
80
72
|
*/
|
|
@@ -266,336 +258,6 @@ declare enum ReloadType {
|
|
|
266
258
|
Global = "global"
|
|
267
259
|
}
|
|
268
260
|
|
|
269
|
-
/**
|
|
270
|
-
* Validation handler options (validationsPath).
|
|
271
|
-
*/
|
|
272
|
-
interface ValidationHandlerOptions {
|
|
273
|
-
validationsPath: string;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* A handler for command validations.
|
|
278
|
-
*/
|
|
279
|
-
declare class ValidationHandler {
|
|
280
|
-
#private;
|
|
281
|
-
constructor({ ...options }: ValidationHandlerOptions);
|
|
282
|
-
init(): Promise<void>;
|
|
283
|
-
get validations(): Function[];
|
|
284
|
-
reloadValidations(): Promise<void>;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Command handler options.
|
|
289
|
-
* Similar to CommandKit options in structure.
|
|
290
|
-
*/
|
|
291
|
-
interface CommandHandlerOptions {
|
|
292
|
-
/**
|
|
293
|
-
* The client created by the user.
|
|
294
|
-
*/
|
|
295
|
-
client: Client;
|
|
296
|
-
/**
|
|
297
|
-
* Path to the user's commands.
|
|
298
|
-
*/
|
|
299
|
-
commandsPath?: string;
|
|
300
|
-
/**
|
|
301
|
-
* An array of developer guild IDs.
|
|
302
|
-
*/
|
|
303
|
-
devGuildIds: string[];
|
|
304
|
-
/**
|
|
305
|
-
* An array of developer user IDs.
|
|
306
|
-
*/
|
|
307
|
-
devUserIds: string[];
|
|
308
|
-
/**
|
|
309
|
-
* An array of developer role IDs.
|
|
310
|
-
*/
|
|
311
|
-
devRoleIds: string[];
|
|
312
|
-
/**
|
|
313
|
-
* A validation handler instance to run validations before commands.
|
|
314
|
-
*/
|
|
315
|
-
validationHandler?: ValidationHandler;
|
|
316
|
-
/**
|
|
317
|
-
* A boolean indicating whether to skip CommandKit's built-in validations (permission checking, etc.)
|
|
318
|
-
*/
|
|
319
|
-
skipBuiltInValidations: boolean;
|
|
320
|
-
/**
|
|
321
|
-
* The CommandKit handler that instantiated this.
|
|
322
|
-
*/
|
|
323
|
-
commandkitInstance: CommandKit;
|
|
324
|
-
/**
|
|
325
|
-
* A boolean indicating whether to register all commands in bulk.
|
|
326
|
-
*/
|
|
327
|
-
bulkRegister: boolean;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* A handler for client application commands.
|
|
332
|
-
*/
|
|
333
|
-
declare class CommandHandler {
|
|
334
|
-
#private;
|
|
335
|
-
constructor({ ...options }: CommandHandlerOptions);
|
|
336
|
-
init(): Promise<void>;
|
|
337
|
-
handleCommands(): void;
|
|
338
|
-
get commands(): CommandFileObject[];
|
|
339
|
-
reloadCommands(type?: ReloadOptions): Promise<void>;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* Event handler options.
|
|
344
|
-
*/
|
|
345
|
-
interface EventHandlerOptions {
|
|
346
|
-
client: Client;
|
|
347
|
-
eventsPath?: string;
|
|
348
|
-
commandKitInstance: CommandKit;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Matcher type for identifying command and middleware files.
|
|
353
|
-
* Can be a string suffix (e.g. '.cmd.js'), RegExp pattern, or custom matcher function.
|
|
354
|
-
*/
|
|
355
|
-
type CommandsRouterMatcher = string | RegExp | ((path: string) => boolean);
|
|
356
|
-
/**
|
|
357
|
-
* Maps file type identifiers to their respective matchers.
|
|
358
|
-
* Used to identify command and middleware files in the directory structure.
|
|
359
|
-
*/
|
|
360
|
-
type CommandsRouterMatchersMap = Record<'command' | 'middleware', CommandsRouterMatcher>;
|
|
361
|
-
/**
|
|
362
|
-
* Configuration options for the CommandsRouter
|
|
363
|
-
*/
|
|
364
|
-
interface CommandsRouterOptions {
|
|
365
|
-
/**
|
|
366
|
-
* The path to the directory containing the command files.
|
|
367
|
-
*/
|
|
368
|
-
entrypoint: string;
|
|
369
|
-
/**
|
|
370
|
-
* The path to the directory containing the middleware files.
|
|
371
|
-
*/
|
|
372
|
-
matcher?: Partial<CommandsRouterMatchersMap>;
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Represents a parsed command with its metadata
|
|
376
|
-
* @interface ParsedCommand
|
|
377
|
-
*/
|
|
378
|
-
interface ParsedCommand {
|
|
379
|
-
/** Command name derived from the file name without extension */
|
|
380
|
-
name: string;
|
|
381
|
-
/** Absolute file system path to the command file */
|
|
382
|
-
path: string;
|
|
383
|
-
/** Parent command name for nested commands, or null if root-level command */
|
|
384
|
-
parent: string | null;
|
|
385
|
-
/** Array of command segments representing the command hierarchy */
|
|
386
|
-
parentSegments: string[];
|
|
387
|
-
/** Array of middleware IDs that apply to this command */
|
|
388
|
-
middlewares: string[];
|
|
389
|
-
/** Absolute path to this command */
|
|
390
|
-
fullPath: string;
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Represents a parsed middleware with its metadata
|
|
394
|
-
* @interface ParsedMiddleware
|
|
395
|
-
*/
|
|
396
|
-
interface ParsedMiddleware {
|
|
397
|
-
/** Unique identifier used to reference this middleware */
|
|
398
|
-
id: string;
|
|
399
|
-
/** Middleware name derived from the file path */
|
|
400
|
-
name: string;
|
|
401
|
-
/** Path to the middleware file, relative to the entrypoint */
|
|
402
|
-
path: string;
|
|
403
|
-
/** Absolute path to the middleware file */
|
|
404
|
-
fullPath: string;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Complete tree structure of all commands and middleware
|
|
408
|
-
* @interface CommandsTree
|
|
409
|
-
*/
|
|
410
|
-
interface CommandsTree {
|
|
411
|
-
/** Map of command names to their parsed metadata */
|
|
412
|
-
commands: Record<string, ParsedCommand>;
|
|
413
|
-
/** Map of middleware IDs to their parsed metadata */
|
|
414
|
-
middleware: Record<string, ParsedMiddleware>;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Result of a successful command match operation
|
|
418
|
-
* @interface CommandMatchResult
|
|
419
|
-
*/
|
|
420
|
-
interface CommandMatchResult {
|
|
421
|
-
/** The matched command metadata */
|
|
422
|
-
command: ParsedCommand;
|
|
423
|
-
/** Array of middleware that apply to the matched command */
|
|
424
|
-
middlewares: ParsedMiddleware[];
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* CommandsRouter handles the discovery and routing of commands and middleware files
|
|
428
|
-
* in a directory structure. It supports nested commands and middleware inheritance.
|
|
429
|
-
*/
|
|
430
|
-
declare class CommandsRouter {
|
|
431
|
-
private readonly options;
|
|
432
|
-
private commands;
|
|
433
|
-
private middlewares;
|
|
434
|
-
/**
|
|
435
|
-
* Creates a new CommandsRouter instance
|
|
436
|
-
* @param options - Configuration options for the router
|
|
437
|
-
*/
|
|
438
|
-
constructor(options: CommandsRouterOptions);
|
|
439
|
-
/**
|
|
440
|
-
* Gets the configured entrypoint directory
|
|
441
|
-
*/
|
|
442
|
-
get entrypoint(): string;
|
|
443
|
-
/**
|
|
444
|
-
* Gets the configured matchers for command and middleware files
|
|
445
|
-
*/
|
|
446
|
-
get matchers(): CommandsRouterMatchersMap;
|
|
447
|
-
/**
|
|
448
|
-
* Returns the cached data of the commands and middleware
|
|
449
|
-
*/
|
|
450
|
-
getData(): {
|
|
451
|
-
commands: Map<string, ParsedCommand>;
|
|
452
|
-
middleware: Map<string, ParsedMiddleware>;
|
|
453
|
-
};
|
|
454
|
-
/**
|
|
455
|
-
* Checks if the entrypoint path is valid
|
|
456
|
-
*/
|
|
457
|
-
isValidPath(): boolean;
|
|
458
|
-
/**
|
|
459
|
-
* Executes a matcher against a file path
|
|
460
|
-
* @param matcher - The matcher to use
|
|
461
|
-
* @param path - The file path to test
|
|
462
|
-
* @returns boolean indicating if the path matches
|
|
463
|
-
*/
|
|
464
|
-
private execMatcher;
|
|
465
|
-
/**
|
|
466
|
-
* Converts an absolute path to a path relative to the entrypoint
|
|
467
|
-
* @param path - The absolute path to convert
|
|
468
|
-
*/
|
|
469
|
-
private resolveRelativePath;
|
|
470
|
-
/**
|
|
471
|
-
* Matches a command by name or path segments
|
|
472
|
-
* @param commandOrSegment - Command name or array of path segments
|
|
473
|
-
* @returns Matched command and its middlewares, or null if no match
|
|
474
|
-
*/
|
|
475
|
-
match(commandOrSegment: string | string[]): CommandMatchResult | null;
|
|
476
|
-
/**
|
|
477
|
-
* Reloads the commands tree by re-scanning the entrypoint directory
|
|
478
|
-
*/
|
|
479
|
-
reload(): Promise<CommandsTree>;
|
|
480
|
-
/**
|
|
481
|
-
* Clears the internal commands and middleware maps
|
|
482
|
-
*/
|
|
483
|
-
clear(): void;
|
|
484
|
-
/**
|
|
485
|
-
* Scans the entrypoint directory for commands and middleware
|
|
486
|
-
* @returns Promise resolving to the complete commands tree
|
|
487
|
-
*/
|
|
488
|
-
scan(): Promise<CommandsTree>;
|
|
489
|
-
/**
|
|
490
|
-
* Converts the internal maps to a serializable object
|
|
491
|
-
* @returns CommandsTree containing all commands and middleware
|
|
492
|
-
*/
|
|
493
|
-
toJSON(): CommandsTree;
|
|
494
|
-
/**
|
|
495
|
-
* Recursively scans a directory for files
|
|
496
|
-
* @param dir - Directory to scan
|
|
497
|
-
* @param entries - Accumulator for found files
|
|
498
|
-
* @returns Promise resolving to array of file paths
|
|
499
|
-
*/
|
|
500
|
-
private scanDirectory;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* Configuration options for the EventsRouter
|
|
505
|
-
* @interface EventsRouterOptions
|
|
506
|
-
*/
|
|
507
|
-
interface EventsRouterOptions {
|
|
508
|
-
/** Root directory path where event handlers are located */
|
|
509
|
-
entrypoint: string;
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Represents a parsed event with its handlers
|
|
513
|
-
* @interface ParsedEvent
|
|
514
|
-
*/
|
|
515
|
-
interface ParsedEvent {
|
|
516
|
-
/** Name of the event derived from directory name */
|
|
517
|
-
event: string;
|
|
518
|
-
/** Absolute path to the event directory */
|
|
519
|
-
path: string;
|
|
520
|
-
/** Array of file paths to event listener handlers */
|
|
521
|
-
listeners: string[];
|
|
522
|
-
}
|
|
523
|
-
/** Map of event names to their parsed metadata */
|
|
524
|
-
type EventsTree = Record<string, ParsedEvent>;
|
|
525
|
-
/**
|
|
526
|
-
* Router for discovering and managing event handler files in a directory structure.
|
|
527
|
-
* Events are represented by directories, and handlers are files within those directories.
|
|
528
|
-
*/
|
|
529
|
-
declare class EventsRouter {
|
|
530
|
-
private options;
|
|
531
|
-
/** Internal storage of parsed events */
|
|
532
|
-
private events;
|
|
533
|
-
/**
|
|
534
|
-
* Creates a new EventsRouter instance
|
|
535
|
-
* @param options - Configuration options for the router
|
|
536
|
-
* @throws Error if entrypoint is not provided
|
|
537
|
-
*/
|
|
538
|
-
constructor(options: EventsRouterOptions);
|
|
539
|
-
/**
|
|
540
|
-
* Find a parsed event by its name
|
|
541
|
-
* @param event - Name of the event to find
|
|
542
|
-
* @returns Parsed event metadata or null if not found
|
|
543
|
-
*/
|
|
544
|
-
match(event: string): ParsedEvent | null;
|
|
545
|
-
/**
|
|
546
|
-
* Get the entrypoint directory path
|
|
547
|
-
* @returns Entrypoint directory path
|
|
548
|
-
*/
|
|
549
|
-
get entrypoint(): string;
|
|
550
|
-
/**
|
|
551
|
-
* Checks if the entrypoint path is valid
|
|
552
|
-
*/
|
|
553
|
-
isValidPath(): boolean;
|
|
554
|
-
/**
|
|
555
|
-
* Clear all parsed events
|
|
556
|
-
*/
|
|
557
|
-
clear(): void;
|
|
558
|
-
/**
|
|
559
|
-
* Reload and re-scan the entrypoint directory for events
|
|
560
|
-
* @returns Promise resolving to the updated events tree
|
|
561
|
-
*/
|
|
562
|
-
reload(): Promise<EventsTree>;
|
|
563
|
-
/**
|
|
564
|
-
* Scan the entrypoint directory for events and their handlers
|
|
565
|
-
* @returns Promise resolving to the events tree
|
|
566
|
-
*/
|
|
567
|
-
scan(): Promise<EventsTree>;
|
|
568
|
-
/**
|
|
569
|
-
* Convert the internal events map to a plain object
|
|
570
|
-
* @returns Events tree as a plain object
|
|
571
|
-
*/
|
|
572
|
-
toJSON(): EventsTree;
|
|
573
|
-
/**
|
|
574
|
-
* Recursively scan a directory for event handlers
|
|
575
|
-
* @param event - Name of the event
|
|
576
|
-
* @param path - Path to the event directory
|
|
577
|
-
* @param listeners - Array to collect listener file paths
|
|
578
|
-
* @returns Promise resolving to the parsed event metadata
|
|
579
|
-
*/
|
|
580
|
-
private scanEvent;
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* A handler for client events.
|
|
585
|
-
*/
|
|
586
|
-
declare class EventHandler {
|
|
587
|
-
#private;
|
|
588
|
-
constructor({ ...options }: EventHandlerOptions);
|
|
589
|
-
init(): Promise<void>;
|
|
590
|
-
registerExternal(entry: ParsedEvent): Promise<void>;
|
|
591
|
-
resyncListeners(): void;
|
|
592
|
-
get events(): {
|
|
593
|
-
name: string;
|
|
594
|
-
functions: Function[];
|
|
595
|
-
}[];
|
|
596
|
-
reloadEvents(commandHandler?: CommandHandler): Promise<void>;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
261
|
interface EventInterceptorContextData<E extends keyof ClientEvents> {
|
|
600
262
|
/**
|
|
601
263
|
* The filter to use for the collector.
|
|
@@ -990,10 +652,10 @@ interface ParsedMessageCommand {
|
|
|
990
652
|
type MessageCommandOptionsSchema = Record<string, ApplicationCommandOptionType>;
|
|
991
653
|
declare class MessageCommandParser {
|
|
992
654
|
#private;
|
|
993
|
-
message: Message;
|
|
655
|
+
message: Message$1;
|
|
994
656
|
private prefix;
|
|
995
657
|
private schema;
|
|
996
|
-
constructor(message: Message, prefix: string[], schema: (command: string) => MessageCommandOptionsSchema);
|
|
658
|
+
constructor(message: Message$1, prefix: string[], schema: (command: string) => MessageCommandOptionsSchema);
|
|
997
659
|
getArgs(): string[];
|
|
998
660
|
get options(): MessageCommandOptions;
|
|
999
661
|
getOption<T>(name: string): T | undefined;
|
|
@@ -1184,7 +846,7 @@ interface ContextParameters<T extends CommandExecutionMode> {
|
|
|
1184
846
|
environment?: CommandKitEnvironment;
|
|
1185
847
|
executionMode: T;
|
|
1186
848
|
interaction: T extends 'chatInput' ? ChatInputCommandInteraction : T extends 'messageContextMenu' ? MessageContextMenuCommandInteraction : T extends 'userContextMenu' ? UserContextMenuCommandInteraction : T extends 'autocomplete' ? AutocompleteInteraction : never;
|
|
1187
|
-
message: T extends 'message' ? Message : never;
|
|
849
|
+
message: T extends 'message' ? Message$1 : never;
|
|
1188
850
|
forwarded?: boolean;
|
|
1189
851
|
messageCommandParser?: T extends 'message' ? MessageCommandParser : never;
|
|
1190
852
|
store?: Map<string, any>;
|
|
@@ -1345,214 +1007,546 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
|
|
|
1345
1007
|
cancel(): void;
|
|
1346
1008
|
}
|
|
1347
1009
|
|
|
1348
|
-
interface
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1010
|
+
interface ParsedCommand {
|
|
1011
|
+
/**
|
|
1012
|
+
* The unique identifier of this command.
|
|
1013
|
+
*/
|
|
1014
|
+
id: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* The file name without the extension.
|
|
1017
|
+
*/
|
|
1018
|
+
name: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* The full path to the command file.
|
|
1021
|
+
* This can be null for directories that function as command groups but have no index file.
|
|
1022
|
+
*/
|
|
1023
|
+
path: string | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* The category of the command.
|
|
1026
|
+
*/
|
|
1027
|
+
category: string | null;
|
|
1028
|
+
/**
|
|
1029
|
+
* The subcommands of this command parsed from `(category)` format, but omitting the brackets.
|
|
1030
|
+
*/
|
|
1031
|
+
subcommands: string[];
|
|
1032
|
+
/**
|
|
1033
|
+
* The middlewares of this command.
|
|
1034
|
+
*/
|
|
1035
|
+
middlewares: string[];
|
|
1368
1036
|
}
|
|
1369
|
-
interface
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1037
|
+
interface ParsedSubCommand {
|
|
1038
|
+
/**
|
|
1039
|
+
* The unique identifier of this subcommand.
|
|
1040
|
+
*/
|
|
1041
|
+
id: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* The file name without the extension.
|
|
1044
|
+
*/
|
|
1045
|
+
name: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* The full path to the subcommand file.
|
|
1048
|
+
*/
|
|
1049
|
+
path: string;
|
|
1050
|
+
/**
|
|
1051
|
+
* The category of the subcommand parsed from `(category)` format, but omitting the brackets.
|
|
1052
|
+
*/
|
|
1053
|
+
category: string | null;
|
|
1054
|
+
/**
|
|
1055
|
+
* The subcommand group name for this subcommand.
|
|
1056
|
+
*/
|
|
1057
|
+
group: string | null;
|
|
1058
|
+
/**
|
|
1059
|
+
* The middlewares of this subcommand.
|
|
1060
|
+
*/
|
|
1061
|
+
middlewares: string[];
|
|
1373
1062
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1063
|
+
interface ParsedMiddleware {
|
|
1064
|
+
/**
|
|
1065
|
+
* The file name without the extension.
|
|
1066
|
+
*/
|
|
1067
|
+
name: string;
|
|
1068
|
+
/**
|
|
1069
|
+
* The unique identifier of this middleware.
|
|
1070
|
+
*/
|
|
1071
|
+
id: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* The full path to this middleware file.
|
|
1074
|
+
*/
|
|
1075
|
+
path: string;
|
|
1076
|
+
/**
|
|
1077
|
+
* The category of this middleware.
|
|
1078
|
+
*/
|
|
1079
|
+
category: string | null;
|
|
1384
1080
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1081
|
+
interface CommandsTree {
|
|
1082
|
+
/**
|
|
1083
|
+
* The record of commands mapped by their unique identifiers.
|
|
1084
|
+
*/
|
|
1085
|
+
commands: Record<string, ParsedCommand>;
|
|
1086
|
+
/**
|
|
1087
|
+
* The record of subcommands mapped by their unique identifiers.
|
|
1088
|
+
*/
|
|
1089
|
+
subcommands: Record<string, ParsedSubCommand>;
|
|
1090
|
+
/**
|
|
1091
|
+
* The record of middlewares mapped by their unique identifiers.
|
|
1092
|
+
*/
|
|
1093
|
+
middlewares: Record<string, ParsedMiddleware>;
|
|
1390
1094
|
}
|
|
1391
|
-
|
|
1392
|
-
#private;
|
|
1393
|
-
readonly eventInterceptor: EventInterceptor;
|
|
1394
|
-
static readonly createElement: typeof createElement;
|
|
1395
|
-
static readonly Fragment: typeof Fragment;
|
|
1396
|
-
readonly config: CommandKitConfiguration;
|
|
1397
|
-
commandsRouter: CommandsRouter;
|
|
1398
|
-
eventsRouter: EventsRouter;
|
|
1399
|
-
appCommandsHandler: AppCommandHandler;
|
|
1400
|
-
static instance: CommandKit | undefined;
|
|
1095
|
+
interface ParsedCommandsData {
|
|
1401
1096
|
/**
|
|
1402
|
-
*
|
|
1403
|
-
*
|
|
1404
|
-
* @param options - The default CommandKit configuration.
|
|
1405
|
-
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
1097
|
+
* The collection of parsed commands.
|
|
1406
1098
|
*/
|
|
1407
|
-
|
|
1099
|
+
commands: Collection<string, ParsedCommand>;
|
|
1408
1100
|
/**
|
|
1409
|
-
*
|
|
1410
|
-
* @param token The application token to connect to the discord gateway. If not provided, it will use the `TOKEN` or `DISCORD_TOKEN` environment variable. If set to `false`, it will not login.
|
|
1101
|
+
* The collection of parsed subcommands.
|
|
1411
1102
|
*/
|
|
1412
|
-
|
|
1103
|
+
subcommands: Collection<string, ParsedSubCommand>;
|
|
1413
1104
|
/**
|
|
1414
|
-
*
|
|
1105
|
+
* The collection of parsed middlewares.
|
|
1415
1106
|
*/
|
|
1416
|
-
|
|
1107
|
+
middlewares: Collection<string, ParsedMiddleware>;
|
|
1108
|
+
}
|
|
1109
|
+
interface CommandsRouterOptions {
|
|
1417
1110
|
/**
|
|
1418
|
-
*
|
|
1419
|
-
* @param resolver The resolver function.
|
|
1111
|
+
* The entrypoint directory to scan for commands.
|
|
1420
1112
|
*/
|
|
1421
|
-
|
|
1113
|
+
entrypoint: string;
|
|
1114
|
+
}
|
|
1115
|
+
declare class CommandsRouter {
|
|
1116
|
+
private readonly options;
|
|
1117
|
+
private commands;
|
|
1118
|
+
private subcommands;
|
|
1119
|
+
private middlewares;
|
|
1120
|
+
constructor(options: CommandsRouterOptions);
|
|
1121
|
+
get entrypoint(): string;
|
|
1122
|
+
isValidPath(): boolean;
|
|
1123
|
+
getData(): ParsedCommandsData;
|
|
1124
|
+
toJSON(): CommandsTree;
|
|
1125
|
+
clear(): void;
|
|
1126
|
+
reload(): Promise<CommandsTree>;
|
|
1127
|
+
scan(): Promise<CommandsTree>;
|
|
1128
|
+
private scanDirectory;
|
|
1129
|
+
private processMiddlewares;
|
|
1130
|
+
private processCommand;
|
|
1131
|
+
private processCommandDirectory;
|
|
1132
|
+
private processSubCommand;
|
|
1133
|
+
private parseNameAndCategory;
|
|
1134
|
+
private findAssociatedMiddlewares;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Configuration options for the EventsRouter
|
|
1139
|
+
* @interface EventsRouterOptions
|
|
1140
|
+
*/
|
|
1141
|
+
interface EventsRouterOptions {
|
|
1142
|
+
/** Root directory path where event handlers are located */
|
|
1143
|
+
entrypoint: string;
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Represents a parsed event with its handlers
|
|
1147
|
+
* @interface ParsedEvent
|
|
1148
|
+
*/
|
|
1149
|
+
interface ParsedEvent {
|
|
1150
|
+
/** Name of the event derived from directory name */
|
|
1151
|
+
event: string;
|
|
1152
|
+
/** Absolute path to the event directory */
|
|
1153
|
+
path: string;
|
|
1154
|
+
/** Array of file paths to event listener handlers */
|
|
1155
|
+
listeners: string[];
|
|
1156
|
+
/** Namespace of the event */
|
|
1157
|
+
namespace: string | null;
|
|
1158
|
+
}
|
|
1159
|
+
/** Map of event names to their parsed metadata */
|
|
1160
|
+
type EventsTree = Record<string, ParsedEvent>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Router for discovering and managing event handler files in a directory structure.
|
|
1163
|
+
* Events are represented by directories, and handlers are files within those directories.
|
|
1164
|
+
*/
|
|
1165
|
+
declare class EventsRouter {
|
|
1166
|
+
private options;
|
|
1167
|
+
/** Internal storage of parsed events */
|
|
1168
|
+
private events;
|
|
1422
1169
|
/**
|
|
1423
|
-
*
|
|
1424
|
-
* @param
|
|
1170
|
+
* Creates a new EventsRouter instance
|
|
1171
|
+
* @param options - Configuration options for the router
|
|
1172
|
+
* @throws Error if entrypoint is not provided
|
|
1425
1173
|
*/
|
|
1426
|
-
|
|
1174
|
+
constructor(options: EventsRouterOptions);
|
|
1427
1175
|
/**
|
|
1428
|
-
*
|
|
1429
|
-
* @param
|
|
1176
|
+
* Find a parsed event by its name
|
|
1177
|
+
* @param event - Name of the event to find
|
|
1178
|
+
* @returns Parsed event metadata or null if not found
|
|
1430
1179
|
*/
|
|
1431
|
-
|
|
1180
|
+
match(event: string): ParsedEvent | null;
|
|
1432
1181
|
/**
|
|
1433
|
-
*
|
|
1182
|
+
* Get the entrypoint directory path
|
|
1183
|
+
* @returns Entrypoint directory path
|
|
1434
1184
|
*/
|
|
1435
|
-
|
|
1185
|
+
get entrypoint(): string;
|
|
1436
1186
|
/**
|
|
1437
|
-
*
|
|
1187
|
+
* Checks if the entrypoint path is valid
|
|
1438
1188
|
*/
|
|
1439
|
-
|
|
1189
|
+
isValidPath(): boolean;
|
|
1440
1190
|
/**
|
|
1441
|
-
*
|
|
1191
|
+
* Clear all parsed events
|
|
1442
1192
|
*/
|
|
1443
|
-
|
|
1193
|
+
clear(): void;
|
|
1444
1194
|
/**
|
|
1445
|
-
*
|
|
1195
|
+
* Reload and re-scan the entrypoint directory for events
|
|
1196
|
+
* @returns Promise resolving to the updated events tree
|
|
1446
1197
|
*/
|
|
1447
|
-
|
|
1198
|
+
reload(): Promise<EventsTree>;
|
|
1448
1199
|
/**
|
|
1449
|
-
*
|
|
1200
|
+
* Scan the entrypoint directory for events and their handlers
|
|
1201
|
+
* @returns Promise resolving to the events tree
|
|
1450
1202
|
*/
|
|
1451
|
-
|
|
1203
|
+
scan(): Promise<EventsTree>;
|
|
1452
1204
|
/**
|
|
1453
|
-
*
|
|
1205
|
+
* Convert the internal events map to a plain object
|
|
1206
|
+
* @returns Events tree as a plain object
|
|
1454
1207
|
*/
|
|
1455
|
-
|
|
1208
|
+
toJSON(): EventsTree;
|
|
1456
1209
|
/**
|
|
1457
|
-
*
|
|
1210
|
+
* Recursively scan a directory for event handlers
|
|
1211
|
+
* @param event - Name of the event
|
|
1212
|
+
* @param path - Path to the event directory
|
|
1213
|
+
* @param listeners - Array to collect listener file paths
|
|
1214
|
+
* @returns Promise resolving to the parsed event metadata
|
|
1458
1215
|
*/
|
|
1459
|
-
|
|
1216
|
+
private scanEvent;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
declare class CommandRegistrar {
|
|
1220
|
+
readonly commandkit: CommandKit;
|
|
1221
|
+
private api;
|
|
1460
1222
|
/**
|
|
1461
|
-
*
|
|
1223
|
+
* Creates an instance of CommandRegistrar.
|
|
1224
|
+
* @param commandkit The commandkit instance.
|
|
1462
1225
|
*/
|
|
1463
|
-
|
|
1226
|
+
constructor(commandkit: CommandKit);
|
|
1464
1227
|
/**
|
|
1465
|
-
*
|
|
1228
|
+
* Gets the commands data.
|
|
1466
1229
|
*/
|
|
1467
|
-
|
|
1230
|
+
getCommandsData(): CommandData[];
|
|
1468
1231
|
/**
|
|
1469
|
-
*
|
|
1232
|
+
* Process and merge subcommands into the parent command's options
|
|
1470
1233
|
*/
|
|
1471
|
-
|
|
1234
|
+
private processSubcommands;
|
|
1472
1235
|
/**
|
|
1473
|
-
*
|
|
1236
|
+
* Registers loaded commands.
|
|
1474
1237
|
*/
|
|
1475
|
-
|
|
1238
|
+
register(): Promise<void>;
|
|
1476
1239
|
/**
|
|
1477
|
-
*
|
|
1240
|
+
* Updates the global commands.
|
|
1478
1241
|
*/
|
|
1479
|
-
|
|
1242
|
+
updateGlobalCommands(commands: CommandData[]): Promise<void>;
|
|
1480
1243
|
/**
|
|
1481
|
-
*
|
|
1244
|
+
* Updates the guild commands.
|
|
1482
1245
|
*/
|
|
1483
|
-
|
|
1246
|
+
updateGuildCommands(commands: CommandData[]): Promise<void>;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
interface AppCommand {
|
|
1250
|
+
command: SlashCommandBuilder | Record<string, any>;
|
|
1251
|
+
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
1252
|
+
autocomplete?: (ctx: Context) => Awaitable<unknown>;
|
|
1253
|
+
message?: (ctx: Context) => Awaitable<unknown>;
|
|
1254
|
+
messageContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1255
|
+
userContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
1256
|
+
}
|
|
1257
|
+
interface AppCommandMiddleware {
|
|
1258
|
+
beforeExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1259
|
+
afterExecute: (ctx: Context) => Awaitable<unknown>;
|
|
1260
|
+
}
|
|
1261
|
+
interface LoadedCommand {
|
|
1262
|
+
command: ParsedCommand;
|
|
1263
|
+
data: AppCommand;
|
|
1264
|
+
subcommands?: ParsedSubCommand[];
|
|
1265
|
+
guilds?: string[];
|
|
1266
|
+
}
|
|
1267
|
+
interface LoadedMiddleware {
|
|
1268
|
+
middleware: ParsedMiddleware;
|
|
1269
|
+
data: AppCommandMiddleware;
|
|
1270
|
+
}
|
|
1271
|
+
interface PreparedAppCommandExecution {
|
|
1272
|
+
command: LoadedCommand;
|
|
1273
|
+
subcommand?: LoadedSubCommand | null;
|
|
1274
|
+
middlewares: LoadedMiddleware[];
|
|
1275
|
+
messageCommandParser?: MessageCommandParser;
|
|
1276
|
+
}
|
|
1277
|
+
interface LoadedSubCommand {
|
|
1278
|
+
subcommand: ParsedSubCommand;
|
|
1279
|
+
data: AppCommand;
|
|
1280
|
+
}
|
|
1281
|
+
type CommandBuilderLike = SlashCommandBuilder | ContextMenuCommandBuilder | Record<string, any>;
|
|
1282
|
+
declare class AppCommandHandler {
|
|
1283
|
+
readonly commandkit: CommandKit;
|
|
1284
|
+
private loadedCommands;
|
|
1285
|
+
private loadedSubCommands;
|
|
1286
|
+
private loadedMiddlewares;
|
|
1287
|
+
private commandNameToId;
|
|
1288
|
+
private subcommandPathToId;
|
|
1289
|
+
readonly registrar: CommandRegistrar;
|
|
1290
|
+
private onInteraction;
|
|
1291
|
+
private onMessageCreate;
|
|
1292
|
+
private onMessageUpdate;
|
|
1293
|
+
constructor(commandkit: CommandKit);
|
|
1294
|
+
getCommandsArray(): LoadedCommand[];
|
|
1484
1295
|
/**
|
|
1485
|
-
*
|
|
1296
|
+
* Get subcommand data by ID for the command registrar
|
|
1486
1297
|
*/
|
|
1487
|
-
|
|
1298
|
+
getSubcommandData(id: string): any;
|
|
1299
|
+
registerCommandHandler(): void;
|
|
1300
|
+
getExecutionMode(source: Interaction | Message$1): CommandExecutionMode;
|
|
1301
|
+
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message$1): Promise<void>;
|
|
1302
|
+
prepareCommandRun(source: Interaction | Message$1): Promise<PreparedAppCommandExecution | null>;
|
|
1303
|
+
reloadCommands(): Promise<void>;
|
|
1304
|
+
loadCommands(): Promise<void>;
|
|
1305
|
+
private loadMiddleware;
|
|
1306
|
+
private loadCommand;
|
|
1307
|
+
private loadSubcommand;
|
|
1308
|
+
applyLocalizations(command: CommandBuilderLike): Promise<discord_js.RESTPostAPIContextMenuApplicationCommandsJSONBody | CommandBuilderLike>;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
declare class AppEventsHandler {
|
|
1312
|
+
readonly commandkit: CommandKit;
|
|
1313
|
+
private loadedEvents;
|
|
1314
|
+
constructor(commandkit: CommandKit);
|
|
1315
|
+
reloadEvents(): Promise<void>;
|
|
1316
|
+
loadEvents(): Promise<void>;
|
|
1317
|
+
unregisterAll(): void;
|
|
1318
|
+
registerAllClientEvents(): void;
|
|
1319
|
+
unregisterAllClientListeners(): void;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
interface OnLoadArgs {
|
|
1323
|
+
path: string;
|
|
1324
|
+
namespace: string;
|
|
1325
|
+
suffix: string;
|
|
1326
|
+
pluginData: any;
|
|
1327
|
+
with: Record<string, string>;
|
|
1328
|
+
}
|
|
1329
|
+
interface OnLoadOptions {
|
|
1330
|
+
filter: RegExp;
|
|
1331
|
+
namespace?: string;
|
|
1332
|
+
}
|
|
1333
|
+
type Loader = `${'j' | 't'}s` | (string & {});
|
|
1334
|
+
interface OnLoadResult {
|
|
1335
|
+
contents?: string | Uint8Array;
|
|
1336
|
+
errors?: Message[];
|
|
1337
|
+
loader?: Loader;
|
|
1338
|
+
pluginData?: any;
|
|
1339
|
+
pluginName?: string;
|
|
1340
|
+
resolveDir?: string;
|
|
1341
|
+
warnings?: Message[];
|
|
1342
|
+
watchDirs?: string[];
|
|
1343
|
+
watchFiles?: string[];
|
|
1344
|
+
}
|
|
1345
|
+
interface Message {
|
|
1346
|
+
text: string;
|
|
1347
|
+
location: Location | null;
|
|
1348
|
+
detail: any;
|
|
1349
|
+
}
|
|
1350
|
+
interface Location {
|
|
1351
|
+
file: string;
|
|
1352
|
+
namespace: string;
|
|
1353
|
+
line: number;
|
|
1354
|
+
column: number;
|
|
1355
|
+
length: number;
|
|
1356
|
+
lineText: string;
|
|
1357
|
+
}
|
|
1358
|
+
interface OnResolveOptions {
|
|
1359
|
+
filter: RegExp;
|
|
1360
|
+
namespace?: string;
|
|
1361
|
+
}
|
|
1362
|
+
interface OnResolveArgs {
|
|
1363
|
+
path: string;
|
|
1364
|
+
importer: string;
|
|
1365
|
+
namespace: string;
|
|
1366
|
+
resolveDir: string;
|
|
1367
|
+
kind: ResolveKind;
|
|
1368
|
+
pluginData: any;
|
|
1369
|
+
with: Record<string, string>;
|
|
1370
|
+
}
|
|
1371
|
+
type ResolveKind = 'entry-point' | 'import-statement' | 'require-call' | 'dynamic-import' | 'require-resolve' | 'import-rule' | 'composes-from' | 'url-token';
|
|
1372
|
+
interface OnResolveResult {
|
|
1373
|
+
errors?: Message[];
|
|
1374
|
+
external?: boolean;
|
|
1375
|
+
namespace?: string;
|
|
1376
|
+
path?: string;
|
|
1377
|
+
pluginData?: any;
|
|
1378
|
+
pluginName?: string;
|
|
1379
|
+
sideEffects?: boolean;
|
|
1380
|
+
suffix?: string;
|
|
1381
|
+
warnings?: Message[];
|
|
1382
|
+
watchDirs?: string[];
|
|
1383
|
+
watchFiles?: string[];
|
|
1384
|
+
}
|
|
1385
|
+
interface Setup {
|
|
1386
|
+
onStart(fn: () => Promise<void>): void;
|
|
1387
|
+
onEnd(fn: () => Promise<void>): void;
|
|
1388
|
+
onDispose(fn: () => Promise<void>): void;
|
|
1389
|
+
onLoad(options: OnLoadOptions, cb: (args: OnLoadArgs) => Promise<OnLoadResult>): Promise<any>;
|
|
1390
|
+
onResolve(options: OnResolveOptions, cb: (args: OnResolveArgs) => Promise<OnResolveResult>): Promise<any>;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
type CommandKitPlugin = RuntimePlugin | CompilerPlugin;
|
|
1394
|
+
type MaybeFalsey<T> = T | false | null | undefined;
|
|
1395
|
+
|
|
1396
|
+
interface PluginTransformParameters {
|
|
1397
|
+
args: OnLoadArgs;
|
|
1398
|
+
path: string;
|
|
1399
|
+
contents: string | Uint8Array;
|
|
1400
|
+
loader?: Loader;
|
|
1401
|
+
}
|
|
1402
|
+
interface TransformedResult {
|
|
1403
|
+
contents?: string | Uint8Array;
|
|
1404
|
+
loader?: Loader;
|
|
1405
|
+
}
|
|
1406
|
+
interface ResolveResult {
|
|
1407
|
+
path?: string;
|
|
1408
|
+
external?: boolean;
|
|
1409
|
+
}
|
|
1410
|
+
declare abstract class CompilerPlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CompilerPluginRuntime> {
|
|
1488
1411
|
/**
|
|
1489
|
-
*
|
|
1412
|
+
* Called when transformation is requested to this plugin
|
|
1413
|
+
* @param params The parameters for the transformation
|
|
1414
|
+
* @returns The transformed result
|
|
1490
1415
|
*/
|
|
1491
|
-
|
|
1416
|
+
transform(params: PluginTransformParameters): Promise<MaybeFalsey<TransformedResult>>;
|
|
1492
1417
|
/**
|
|
1493
|
-
*
|
|
1418
|
+
* Called when a resolve is requested to this plugin
|
|
1419
|
+
* @param args The arguments for the resolve
|
|
1420
|
+
* @returns The resolved result
|
|
1494
1421
|
*/
|
|
1495
|
-
|
|
1422
|
+
resolve(args: OnResolveArgs): Promise<MaybeFalsey<ResolveResult>>;
|
|
1496
1423
|
/**
|
|
1497
|
-
*
|
|
1498
|
-
* The lookup order is:
|
|
1499
|
-
* - `./app`
|
|
1500
|
-
* - `./src/app`
|
|
1424
|
+
* Called when a build is started
|
|
1501
1425
|
*/
|
|
1502
|
-
|
|
1503
|
-
|
|
1426
|
+
onBuildStart(): Promise<void>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Called when a build is ended
|
|
1429
|
+
*/
|
|
1430
|
+
onBuildEnd(): Promise<void>;
|
|
1504
1431
|
}
|
|
1505
1432
|
|
|
1506
|
-
|
|
1433
|
+
declare class CompilerPluginRuntime {
|
|
1434
|
+
private readonly plugins;
|
|
1435
|
+
readonly name = "CompilerPluginRuntime";
|
|
1436
|
+
constructor(plugins: CompilerPlugin[]);
|
|
1437
|
+
isEmpty(): boolean;
|
|
1438
|
+
private onLoad;
|
|
1439
|
+
private onResolve;
|
|
1440
|
+
private onStart;
|
|
1441
|
+
private onEnd;
|
|
1442
|
+
private onDispose;
|
|
1443
|
+
private onInit;
|
|
1444
|
+
cleanup(): Promise<void>;
|
|
1445
|
+
setup(build: Setup): Promise<void>;
|
|
1446
|
+
toEsbuildPlugin(): {
|
|
1447
|
+
name: string;
|
|
1448
|
+
setup: (build: Setup) => Promise<void>;
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
type CommonPluginRuntime = CommandKitPluginRuntime | CompilerPluginRuntime;
|
|
1453
|
+
|
|
1454
|
+
type PluginOptions = Record<string, any>;
|
|
1455
|
+
declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C extends CommonPluginRuntime = CommonPluginRuntime> {
|
|
1456
|
+
protected readonly options: T;
|
|
1457
|
+
abstract readonly name: string;
|
|
1458
|
+
constructor(options: T);
|
|
1507
1459
|
/**
|
|
1508
|
-
*
|
|
1460
|
+
* Called when this plugin is activated
|
|
1509
1461
|
*/
|
|
1510
|
-
|
|
1462
|
+
activate(ctx: C): Promise<void>;
|
|
1511
1463
|
/**
|
|
1512
|
-
*
|
|
1464
|
+
* Called when this plugin is deactivated
|
|
1513
1465
|
*/
|
|
1514
|
-
|
|
1466
|
+
deactivate(ctx: C): Promise<void>;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
declare class DefaultLocalizationStrategy implements LocalizationStrategy {
|
|
1470
|
+
private readonly commandkit;
|
|
1471
|
+
private translations;
|
|
1472
|
+
constructor(commandkit: CommandKit);
|
|
1473
|
+
locateTranslation(scope: string, locale: Locale): Promise<Translation | null>;
|
|
1474
|
+
getTranslationStrict(scope: string, locale: Locale): Promise<Translation>;
|
|
1475
|
+
getTranslation(scope: string, locale: Locale): Promise<Translation | null>;
|
|
1476
|
+
translate(request: LocalizationTranslationRequest): Promise<TranslationResult>;
|
|
1477
|
+
private applyTranslation;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
/**
|
|
1481
|
+
* Cancel upcoming middleware execution.
|
|
1482
|
+
* If this is called inside pre-stage middleware, the next run will be the actual command, skipping all other pre-stage middlewares.
|
|
1483
|
+
* If this is called inside a command itself, it will skip all post-stage middlewares.
|
|
1484
|
+
* If this is called inside post-stage middleware, it will skip all other post-stage middlewares.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function exitMiddleware(): never;
|
|
1487
|
+
/**
|
|
1488
|
+
* Rethrow the error if it is a CommandKit error.
|
|
1489
|
+
* @param error The error to rethrow.
|
|
1490
|
+
*/
|
|
1491
|
+
declare function rethrow(error: unknown): void;
|
|
1492
|
+
/**
|
|
1493
|
+
* Stops current command assuming it has been redirected to another command.
|
|
1494
|
+
*/
|
|
1495
|
+
declare function redirect(): never;
|
|
1496
|
+
|
|
1497
|
+
declare abstract class RuntimePlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CommandKitPluginRuntime> {
|
|
1498
|
+
/**
|
|
1499
|
+
* Called before commands are loaded
|
|
1500
|
+
*/
|
|
1501
|
+
onBeforeCommandsLoad(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1502
|
+
/**
|
|
1503
|
+
* Called after commands are loaded
|
|
1504
|
+
*/
|
|
1505
|
+
onAfterCommandsLoad(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Called before events are loaded
|
|
1508
|
+
*/
|
|
1509
|
+
onBeforeEventsLoad(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1515
1510
|
/**
|
|
1516
|
-
*
|
|
1511
|
+
* Called after events are loaded
|
|
1517
1512
|
*/
|
|
1518
|
-
|
|
1513
|
+
onAfterEventsLoad(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1519
1514
|
/**
|
|
1520
|
-
*
|
|
1515
|
+
* Called before the client logs in
|
|
1521
1516
|
*/
|
|
1522
|
-
|
|
1517
|
+
onBeforeClientLogin(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1523
1518
|
/**
|
|
1524
|
-
*
|
|
1519
|
+
* Called after the client logs in
|
|
1525
1520
|
*/
|
|
1526
|
-
|
|
1521
|
+
onAfterClientLogin(ctx: CommandKitPluginRuntime): Promise<void>;
|
|
1527
1522
|
/**
|
|
1528
|
-
*
|
|
1523
|
+
* Called before interaction is handled
|
|
1524
|
+
* @param interaction The interaction
|
|
1529
1525
|
*/
|
|
1530
|
-
|
|
1526
|
+
onBeforeInteraction(ctx: CommandKitPluginRuntime, interaction: Interaction): Promise<void>;
|
|
1531
1527
|
/**
|
|
1532
|
-
*
|
|
1528
|
+
* Called after interaction is handled
|
|
1529
|
+
* @param interaction The interaction that was handled
|
|
1533
1530
|
*/
|
|
1534
|
-
|
|
1531
|
+
onAfterInteraction(ctx: CommandKitPluginRuntime, interaction: Interaction): Promise<void>;
|
|
1535
1532
|
/**
|
|
1536
|
-
*
|
|
1533
|
+
* Called before message command is processed
|
|
1534
|
+
* @param message The message
|
|
1537
1535
|
*/
|
|
1538
|
-
|
|
1536
|
+
onBeforeMessageCommand(ctx: CommandKitPluginRuntime, message: Message$1): Promise<void>;
|
|
1539
1537
|
/**
|
|
1540
|
-
*
|
|
1538
|
+
* Called before message update command is processed
|
|
1539
|
+
* @param message The message
|
|
1541
1540
|
*/
|
|
1542
|
-
|
|
1541
|
+
onBeforeMessageUpdateCommand(ctx: CommandKitPluginRuntime, oldMessage: Message$1 | PartialMessage, newMessage: Message$1 | PartialMessage): Promise<void>;
|
|
1542
|
+
/**
|
|
1543
|
+
* Called before command is executed. This method can execute the command itself.
|
|
1544
|
+
* @param source The source that triggered the command
|
|
1545
|
+
* @param command The command
|
|
1546
|
+
* @param execute The function that executes the command
|
|
1547
|
+
*/
|
|
1548
|
+
executeCommand(ctx: CommandKitPluginRuntime, source: Interaction | Message$1, command: PreparedAppCommandExecution, execute: () => Promise<any>): Promise<boolean>;
|
|
1543
1549
|
}
|
|
1544
|
-
declare function getConfig(): CommandKitConfig;
|
|
1545
|
-
declare function defineConfig(config: Partial<CommandKitConfig>): {
|
|
1546
|
-
outDir: string;
|
|
1547
|
-
watch: boolean;
|
|
1548
|
-
envExtra: boolean;
|
|
1549
|
-
nodeOptions: string[];
|
|
1550
|
-
clearRestartLogs: boolean;
|
|
1551
|
-
minify: boolean;
|
|
1552
|
-
sourcemap: boolean | "inline";
|
|
1553
|
-
antiCrash: boolean;
|
|
1554
|
-
requirePolyfill: boolean;
|
|
1555
|
-
};
|
|
1556
1550
|
|
|
1557
1551
|
declare class MemoryCache extends CacheProvider {
|
|
1558
1552
|
#private;
|
|
@@ -1682,33 +1676,224 @@ declare function revalidate<T = unknown>(tag: string, ...args: any[]): Promise<T
|
|
|
1682
1676
|
*/
|
|
1683
1677
|
declare function isCachedFunction(fn: GenericFunction): boolean;
|
|
1684
1678
|
|
|
1685
|
-
declare class
|
|
1686
|
-
|
|
1687
|
-
private
|
|
1679
|
+
declare class CommandKitPluginRuntime extends EventTarget {
|
|
1680
|
+
readonly commandkit: CommandKit;
|
|
1681
|
+
private plugins;
|
|
1682
|
+
private onClientLogin;
|
|
1688
1683
|
constructor(commandkit: CommandKit);
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1684
|
+
getPlugin(pluginName: string): RuntimePlugin | null;
|
|
1685
|
+
registerPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1686
|
+
unregisterPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1687
|
+
unregisterAllPlugins(): Promise<void>;
|
|
1688
|
+
capture(): void;
|
|
1689
|
+
execute<R = any>(f: AsyncFunction<[CommandKitPluginRuntime, RuntimePlugin], R | undefined>): Promise<true | R | undefined>;
|
|
1694
1690
|
}
|
|
1695
1691
|
|
|
1692
|
+
interface CommandKitConfiguration {
|
|
1693
|
+
defaultLocale: Locale;
|
|
1694
|
+
localizationStrategy: LocalizationStrategy;
|
|
1695
|
+
getMessageCommandPrefix: (message: Message$1) => Awaitable<string | string[]>;
|
|
1696
|
+
}
|
|
1697
|
+
declare class CommandKit extends EventEmitter {
|
|
1698
|
+
#private;
|
|
1699
|
+
private options;
|
|
1700
|
+
readonly eventInterceptor: EventInterceptor;
|
|
1701
|
+
static readonly createElement: typeof createElement;
|
|
1702
|
+
static readonly Fragment: typeof Fragment;
|
|
1703
|
+
readonly config: CommandKitConfiguration;
|
|
1704
|
+
commandsRouter: CommandsRouter;
|
|
1705
|
+
eventsRouter: EventsRouter;
|
|
1706
|
+
readonly commandHandler: AppCommandHandler;
|
|
1707
|
+
readonly eventHandler: AppEventsHandler;
|
|
1708
|
+
readonly plugins: CommandKitPluginRuntime;
|
|
1709
|
+
static instance: CommandKit | undefined;
|
|
1710
|
+
/**
|
|
1711
|
+
* Create a new command and event handler with CommandKit.
|
|
1712
|
+
*
|
|
1713
|
+
* @param options - The default CommandKit configuration.
|
|
1714
|
+
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
1715
|
+
*/
|
|
1716
|
+
constructor(options: CommandKitOptions);
|
|
1717
|
+
/**
|
|
1718
|
+
* Starts the commandkit application.
|
|
1719
|
+
* @param token The application token to connect to the discord gateway. If not provided, it will use the `TOKEN` or `DISCORD_TOKEN` environment variable. If set to `false`, it will not login.
|
|
1720
|
+
*/
|
|
1721
|
+
start(token?: string | false): Promise<void>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Whether or not the commandkit application has started.
|
|
1724
|
+
*/
|
|
1725
|
+
get started(): boolean;
|
|
1726
|
+
/**
|
|
1727
|
+
* Sets the prefix resolver for the command handler.
|
|
1728
|
+
* @param resolver The resolver function.
|
|
1729
|
+
*/
|
|
1730
|
+
setPrefixResolver(resolver: (message: Message$1) => Awaitable<string | string[]>): this;
|
|
1731
|
+
/**
|
|
1732
|
+
* Sets the default locale for the command handler.
|
|
1733
|
+
* @param locale The default locale.
|
|
1734
|
+
*/
|
|
1735
|
+
setDefaultLocale(locale: Locale): this;
|
|
1736
|
+
/**
|
|
1737
|
+
* Sets the localization strategy for the command handler.
|
|
1738
|
+
* @param strategy The localization strategy.
|
|
1739
|
+
*/
|
|
1740
|
+
setLocalizationStrategy(strategy: LocalizationStrategy): this;
|
|
1741
|
+
/**
|
|
1742
|
+
* Resolves the current cache provider.
|
|
1743
|
+
*/
|
|
1744
|
+
getCacheProvider(): CacheProvider | null;
|
|
1745
|
+
/**
|
|
1746
|
+
* Whether or not to debug the command handler.
|
|
1747
|
+
*/
|
|
1748
|
+
isDebuggingCommands(): boolean;
|
|
1749
|
+
/**
|
|
1750
|
+
* Get the client attached to this CommandKit instance.
|
|
1751
|
+
*/
|
|
1752
|
+
get client(): discord_js.Client<boolean>;
|
|
1753
|
+
/**
|
|
1754
|
+
* Updates application commands with the latest from "commandsPath".
|
|
1755
|
+
*/
|
|
1756
|
+
reloadCommands(): Promise<void>;
|
|
1757
|
+
/**
|
|
1758
|
+
* Updates application events with the latest from "eventsPath".
|
|
1759
|
+
*/
|
|
1760
|
+
reloadEvents(): Promise<void>;
|
|
1761
|
+
/**
|
|
1762
|
+
* @returns The path to the commands folder which was set when instantiating CommandKit.
|
|
1763
|
+
*/
|
|
1764
|
+
get commandsPath(): string | undefined;
|
|
1765
|
+
/**
|
|
1766
|
+
* @returns The path to the events folder which was set when instantiating CommandKit.
|
|
1767
|
+
*/
|
|
1768
|
+
get eventsPath(): string | undefined;
|
|
1769
|
+
/**
|
|
1770
|
+
* @returns The path to the validations folder which was set when instantiating CommandKit.
|
|
1771
|
+
*/
|
|
1772
|
+
get validationsPath(): string | undefined;
|
|
1773
|
+
/**
|
|
1774
|
+
* @returns An array of all the developer user IDs which was set when instantiating CommandKit.
|
|
1775
|
+
*/
|
|
1776
|
+
get devUserIds(): string[];
|
|
1777
|
+
/**
|
|
1778
|
+
* @returns An array of all the developer guild IDs which was set when instantiating CommandKit.
|
|
1779
|
+
*/
|
|
1780
|
+
get devGuildIds(): string[];
|
|
1781
|
+
/**
|
|
1782
|
+
* @returns An array of all the developer role IDs which was set when instantiating CommandKit.
|
|
1783
|
+
*/
|
|
1784
|
+
get devRoleIds(): string[];
|
|
1785
|
+
/**
|
|
1786
|
+
* Increment the client listeners count.
|
|
1787
|
+
*/
|
|
1788
|
+
incrementClientListenersCount(): void;
|
|
1789
|
+
/**
|
|
1790
|
+
* Decrement the client listeners count.
|
|
1791
|
+
*/
|
|
1792
|
+
decrementClientListenersCount(): void;
|
|
1793
|
+
/**
|
|
1794
|
+
* Path to the app directory. Returns `null` if not found.
|
|
1795
|
+
* The lookup order is:
|
|
1796
|
+
* - `./app`
|
|
1797
|
+
* - `./src/app`
|
|
1798
|
+
*/
|
|
1799
|
+
getAppDirectory(): string | null;
|
|
1800
|
+
getPath(to: 'locales' | 'commands' | 'events'): string | null;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
interface CommandKitConfig {
|
|
1804
|
+
/**
|
|
1805
|
+
* The plugins to use with CommandKit.
|
|
1806
|
+
*/
|
|
1807
|
+
plugins?: CommandKitPlugin[];
|
|
1808
|
+
/**
|
|
1809
|
+
* The esbuild plugins to use with CommandKit.
|
|
1810
|
+
*/
|
|
1811
|
+
esbuildPlugins?: any[];
|
|
1812
|
+
/**
|
|
1813
|
+
* The compiler options to use with CommandKit.
|
|
1814
|
+
*/
|
|
1815
|
+
compilerOptions?: {
|
|
1816
|
+
/**
|
|
1817
|
+
* Macro compiler configuration.
|
|
1818
|
+
*/
|
|
1819
|
+
macro?: {
|
|
1820
|
+
/**
|
|
1821
|
+
* Whether to enable macro function compilation in development mode.
|
|
1822
|
+
* @default false
|
|
1823
|
+
*/
|
|
1824
|
+
development?: boolean;
|
|
1825
|
+
};
|
|
1826
|
+
/**
|
|
1827
|
+
* Cached function compiler configuration.
|
|
1828
|
+
*/
|
|
1829
|
+
cache?: {
|
|
1830
|
+
/**
|
|
1831
|
+
* Whether to enable caching of compiled functions in development mode.
|
|
1832
|
+
*/
|
|
1833
|
+
development?: boolean;
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
/**
|
|
1837
|
+
* The typescript configuration to use with CommandKit.
|
|
1838
|
+
*/
|
|
1839
|
+
typescript?: {
|
|
1840
|
+
/**
|
|
1841
|
+
* Whether to ignore type checking during builds.
|
|
1842
|
+
*/
|
|
1843
|
+
ignoreDuringBuilds?: boolean;
|
|
1844
|
+
};
|
|
1845
|
+
/**
|
|
1846
|
+
* Whether to generate static command handler data in production builds.
|
|
1847
|
+
*/
|
|
1848
|
+
static?: boolean;
|
|
1849
|
+
/**
|
|
1850
|
+
* Statically define the environment variables to use.
|
|
1851
|
+
*/
|
|
1852
|
+
env?: Record<string, string>;
|
|
1853
|
+
/**
|
|
1854
|
+
* The custom build directory name to use.
|
|
1855
|
+
* @default `dist`
|
|
1856
|
+
*/
|
|
1857
|
+
distDir?: string;
|
|
1858
|
+
/**
|
|
1859
|
+
* Whether or not to enable the source map generation.
|
|
1860
|
+
*/
|
|
1861
|
+
sourceMap?: {
|
|
1862
|
+
/**
|
|
1863
|
+
* Whether to enable source map generation in development mode.
|
|
1864
|
+
*/
|
|
1865
|
+
development?: boolean;
|
|
1866
|
+
/**
|
|
1867
|
+
* Whether to enable source map generation in production mode.
|
|
1868
|
+
*/
|
|
1869
|
+
production?: boolean;
|
|
1870
|
+
};
|
|
1871
|
+
/**
|
|
1872
|
+
* Whether or not to enable typed locales.
|
|
1873
|
+
* @default true
|
|
1874
|
+
*/
|
|
1875
|
+
typedLocales?: boolean;
|
|
1876
|
+
/**
|
|
1877
|
+
* Whether or not to enable the typed commands.
|
|
1878
|
+
* @default true
|
|
1879
|
+
*/
|
|
1880
|
+
typedCommands?: boolean;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
type DeepRequired<T> = {
|
|
1884
|
+
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
1885
|
+
};
|
|
1886
|
+
type ResolvedCommandKitConfig = DeepRequired<CommandKitConfig>;
|
|
1887
|
+
|
|
1696
1888
|
/**
|
|
1697
|
-
*
|
|
1698
|
-
* If this is called inside pre-stage middleware, the next run will be the actual command, skipping all other pre-stage middlewares.
|
|
1699
|
-
* If this is called inside a command itself, it will skip all post-stage middlewares.
|
|
1700
|
-
* If this is called inside post-stage middleware, it will skip all other post-stage middlewares.
|
|
1701
|
-
*/
|
|
1702
|
-
declare function exitMiddleware(): never;
|
|
1703
|
-
/**
|
|
1704
|
-
* Rethrow the error if it is a CommandKit error.
|
|
1705
|
-
* @param error The error to rethrow.
|
|
1889
|
+
* Get the defined configuration for CommandKit.
|
|
1706
1890
|
*/
|
|
1707
|
-
declare function
|
|
1891
|
+
declare function getConfig(): ResolvedCommandKitConfig;
|
|
1708
1892
|
/**
|
|
1709
|
-
*
|
|
1893
|
+
* Define the configuration for CommandKit.
|
|
1894
|
+
* @param config The configuration to use.
|
|
1710
1895
|
*/
|
|
1711
|
-
declare function
|
|
1896
|
+
declare function defineConfig(config?: Partial<CommandKitConfig>): ResolvedCommandKitConfig;
|
|
1712
1897
|
|
|
1713
1898
|
interface ILogger {
|
|
1714
1899
|
log(...args: any[]): void;
|
|
@@ -1755,6 +1940,11 @@ interface LoggerImpl extends ILogger {
|
|
|
1755
1940
|
declare function createLogger(options: CommandKitLoggerOptions): LoggerImpl;
|
|
1756
1941
|
declare const Logger: LoggerImpl;
|
|
1757
1942
|
|
|
1943
|
+
/**
|
|
1944
|
+
* The current version of CommandKit.
|
|
1945
|
+
*/
|
|
1946
|
+
declare const version: string;
|
|
1947
|
+
|
|
1758
1948
|
/**
|
|
1759
1949
|
* Creates a command line interface for CommandKit.
|
|
1760
1950
|
* @param argv The arguments passed to the CLI.
|
|
@@ -1762,9 +1952,4 @@ declare const Logger: LoggerImpl;
|
|
|
1762
1952
|
*/
|
|
1763
1953
|
declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
|
|
1764
1954
|
|
|
1765
|
-
|
|
1766
|
-
* The current version of CommandKit.
|
|
1767
|
-
*/
|
|
1768
|
-
declare const version: string;
|
|
1769
|
-
|
|
1770
|
-
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 CommandKitConfig, type CommandKitConfiguration, type CommandKitData, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandMatchResult, type CommandObject, type CommandOptions, type CommandProps, CommandsRouter, type CommandsRouterMatcher, type CommandsRouterMatchersMap, type CommandsRouterOptions, type CommandsTree, 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, 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, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnModalKitEnd, type OnModalKitSubmit, ParagraphInput, type ParsedCommand, type ParsedEvent, type ParsedMessageCommand, type ParsedMiddleware, type PreparedAppCommandExecution, type ReloadOptions, ReloadType, 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 };
|
|
1955
|
+
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, CommandsRouter, type CommandsRouterOptions, type CommandsTree, 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, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnModalKitEnd, type OnModalKitSubmit, ParagraphInput, type ParsedCommand, type ParsedCommandsData, type ParsedEvent, type ParsedMessageCommand, type ParsedMiddleware, type ParsedSubCommand, type PreparedAppCommandExecution, type ReloadOptions, ReloadType, 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 };
|