commandkit 0.1.11-dev.20250330063035 → 0.1.11-dev.20250330065036
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 +1 -0
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1164,6 +1164,7 @@ declare class AppCommandHandler {
|
|
|
1164
1164
|
private onMessageUpdate;
|
|
1165
1165
|
readonly commandRunner: AppCommandRunner;
|
|
1166
1166
|
constructor(commandkit: CommandKit);
|
|
1167
|
+
printBanner(): void;
|
|
1167
1168
|
getCommandsArray(): LoadedCommand[];
|
|
1168
1169
|
registerCommandHandler(): void;
|
|
1169
1170
|
prepareCommandRun(source: Interaction | Message$1, cmdName?: string): Promise<PreparedAppCommandExecution | null>;
|
package/dist/index.js
CHANGED
|
@@ -3437,6 +3437,7 @@ var init_AppCommandHandler = __esm({
|
|
|
3437
3437
|
init_AppCommandRunner();
|
|
3438
3438
|
init_constants();
|
|
3439
3439
|
init_types_package();
|
|
3440
|
+
init_colors();
|
|
3440
3441
|
commandDataSchema = {
|
|
3441
3442
|
command: /* @__PURE__ */ __name((c) => c instanceof import_discord10.SlashCommandBuilder || c instanceof import_discord10.ContextMenuCommandBuilder || c && typeof c === "object", "command"),
|
|
3442
3443
|
chatInput: /* @__PURE__ */ __name((c) => typeof c === "function", "chatInput"),
|
|
@@ -3464,6 +3465,41 @@ var init_AppCommandHandler = __esm({
|
|
|
3464
3465
|
onMessageCreate = null;
|
|
3465
3466
|
onMessageUpdate = null;
|
|
3466
3467
|
commandRunner = new AppCommandRunner(this);
|
|
3468
|
+
printBanner() {
|
|
3469
|
+
const categorizedCommands = this.getCommandsArray().reduce(
|
|
3470
|
+
(acc, cmd) => {
|
|
3471
|
+
const category = cmd.command.category || "uncategorized";
|
|
3472
|
+
acc[category] = acc[category] || [];
|
|
3473
|
+
acc[category].push(cmd);
|
|
3474
|
+
return acc;
|
|
3475
|
+
},
|
|
3476
|
+
{}
|
|
3477
|
+
);
|
|
3478
|
+
const categories = Object.keys(categorizedCommands).sort();
|
|
3479
|
+
console.log(
|
|
3480
|
+
colors_default.green(
|
|
3481
|
+
`Loaded ${colors_default.magenta(this.loadedCommands.size.toString())} commands:`
|
|
3482
|
+
)
|
|
3483
|
+
);
|
|
3484
|
+
categories.forEach((category, index) => {
|
|
3485
|
+
const commands = categorizedCommands[category];
|
|
3486
|
+
const isLastCategory = index === categories.length - 1;
|
|
3487
|
+
const categoryPrefix = isLastCategory ? "\u2514\u2500" : "\u251C\u2500";
|
|
3488
|
+
if (category !== "uncategorized") {
|
|
3489
|
+
console.log(colors_default.cyan(`${categoryPrefix} ${colors_default.bold(category)}`));
|
|
3490
|
+
}
|
|
3491
|
+
commands.forEach((cmd, cmdIndex) => {
|
|
3492
|
+
const isLastCommand = cmdIndex === commands.length - 1;
|
|
3493
|
+
const commandPrefix = category !== "uncategorized" ? (isLastCategory ? " " : "\u2502 ") + (isLastCommand ? "\u2514\u2500" : "\u251C\u2500") : isLastCommand ? "\u2514\u2500" : "\u251C\u2500";
|
|
3494
|
+
const name = cmd.data.command.name;
|
|
3495
|
+
const hasMw = cmd.command.middlewares.length > 0;
|
|
3496
|
+
const middlewareIcon = hasMw ? colors_default.magenta(" (\u03BB)") : "";
|
|
3497
|
+
console.log(
|
|
3498
|
+
`${colors_default.green(commandPrefix)} ${colors_default.yellow(name)}${middlewareIcon}`
|
|
3499
|
+
);
|
|
3500
|
+
});
|
|
3501
|
+
});
|
|
3502
|
+
}
|
|
3467
3503
|
getCommandsArray() {
|
|
3468
3504
|
return Array.from(this.loadedCommands.values());
|
|
3469
3505
|
}
|
|
@@ -3803,7 +3839,7 @@ var init_CommandsRouter = __esm({
|
|
|
3803
3839
|
import_promises4 = require("fs/promises");
|
|
3804
3840
|
import_node_path4 = require("path");
|
|
3805
3841
|
MIDDLEWARE_PATTERN = /^\+middleware\.(m|c)?(j|t)sx?$/;
|
|
3806
|
-
COMMAND_PATTERN = /^(
|
|
3842
|
+
COMMAND_PATTERN = /^([^+().][^().]*)\.(m|c)?(j|t)sx?$/;
|
|
3807
3843
|
CATEGORY_PATTERN = /^\(\w+\)$/;
|
|
3808
3844
|
_CommandsRouter = class _CommandsRouter {
|
|
3809
3845
|
constructor(options) {
|
|
@@ -4642,6 +4678,7 @@ var init_CommandKit = __esm({
|
|
|
4642
4678
|
await this.plugins.execute((ctx, plugin) => {
|
|
4643
4679
|
return plugin.onAfterCommandsLoad(ctx);
|
|
4644
4680
|
});
|
|
4681
|
+
this.commandHandler.printBanner();
|
|
4645
4682
|
}, "#initCommands");
|
|
4646
4683
|
initEvents_fn = /* @__PURE__ */ __name(async function() {
|
|
4647
4684
|
await this.plugins.execute((ctx, plugin) => {
|
|
@@ -4674,7 +4711,7 @@ var init_version = __esm({
|
|
|
4674
4711
|
"use strict";
|
|
4675
4712
|
init_cjs_shims();
|
|
4676
4713
|
version = /* @__MACRO__ $version */
|
|
4677
|
-
"0.1.11-dev.
|
|
4714
|
+
"0.1.11-dev.20250330065036";
|
|
4678
4715
|
}
|
|
4679
4716
|
});
|
|
4680
4717
|
|