commandkit 0.1.8 → 0.1.9-dev.20231212192829
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.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +56 -56
package/dist/index.d.mts
CHANGED
|
@@ -66,7 +66,7 @@ interface CommandProps {
|
|
|
66
66
|
/**
|
|
67
67
|
* Props for autocomplete command run functions.
|
|
68
68
|
*/
|
|
69
|
-
interface
|
|
69
|
+
interface AutocompleteProps extends CommandProps {
|
|
70
70
|
/**
|
|
71
71
|
* The current autocomplete command interaction object.
|
|
72
72
|
*/
|
|
@@ -105,11 +105,11 @@ interface MessageContextMenuCommandProps extends CommandProps {
|
|
|
105
105
|
/**
|
|
106
106
|
* Props for command validation functions.
|
|
107
107
|
*/
|
|
108
|
-
interface
|
|
108
|
+
interface ValidationProps {
|
|
109
109
|
/**
|
|
110
110
|
* The current command interaction object.
|
|
111
111
|
*/
|
|
112
|
-
interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction;
|
|
112
|
+
interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
|
|
113
113
|
/**
|
|
114
114
|
* The Discord.js client object that CommandKit is handling.
|
|
115
115
|
*/
|
|
@@ -375,4 +375,4 @@ declare function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T
|
|
|
375
375
|
*/
|
|
376
376
|
declare function createEffect(callback: CommandKitEffectCallback): void;
|
|
377
377
|
|
|
378
|
-
export {
|
|
378
|
+
export { AutocompleteProps, ButtonKit, CommandData, CommandKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitConfig, CommandKitEffectCallback, CommandKitSignal, CommandKitSignalInitializer, CommandKitSignalUpdater, CommandObject, CommandOptions, CommandProps, ContextMenuCommandProps, MessageContextMenuCommandProps, ReloadType, SlashCommandProps, UserContextMenuCommandProps, ValidationProps, createEffect, createSignal, defineConfig, getConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ interface CommandProps {
|
|
|
66
66
|
/**
|
|
67
67
|
* Props for autocomplete command run functions.
|
|
68
68
|
*/
|
|
69
|
-
interface
|
|
69
|
+
interface AutocompleteProps extends CommandProps {
|
|
70
70
|
/**
|
|
71
71
|
* The current autocomplete command interaction object.
|
|
72
72
|
*/
|
|
@@ -105,11 +105,11 @@ interface MessageContextMenuCommandProps extends CommandProps {
|
|
|
105
105
|
/**
|
|
106
106
|
* Props for command validation functions.
|
|
107
107
|
*/
|
|
108
|
-
interface
|
|
108
|
+
interface ValidationProps {
|
|
109
109
|
/**
|
|
110
110
|
* The current command interaction object.
|
|
111
111
|
*/
|
|
112
|
-
interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction;
|
|
112
|
+
interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
|
|
113
113
|
/**
|
|
114
114
|
* The Discord.js client object that CommandKit is handling.
|
|
115
115
|
*/
|
|
@@ -375,4 +375,4 @@ declare function createSignal<T = unknown>(value?: CommandKitSignalInitializer<T
|
|
|
375
375
|
*/
|
|
376
376
|
declare function createEffect(callback: CommandKitEffectCallback): void;
|
|
377
377
|
|
|
378
|
-
export {
|
|
378
|
+
export { AutocompleteProps, ButtonKit, CommandData, CommandKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitConfig, CommandKitEffectCallback, CommandKitSignal, CommandKitSignalInitializer, CommandKitSignalUpdater, CommandObject, CommandOptions, CommandProps, ContextMenuCommandProps, MessageContextMenuCommandProps, ReloadType, SlashCommandProps, UserContextMenuCommandProps, ValidationProps, createEffect, createSignal, defineConfig, getConfig };
|
package/dist/index.js
CHANGED
|
@@ -594,8 +594,8 @@ var CommandHandler = class {
|
|
|
594
594
|
);
|
|
595
595
|
if (!targetCommand)
|
|
596
596
|
return;
|
|
597
|
-
const { data, options, run,
|
|
598
|
-
if (isAutocomplete && !
|
|
597
|
+
const { data, options, run, autocomplete, ...rest } = targetCommand;
|
|
598
|
+
if (isAutocomplete && !autocomplete)
|
|
599
599
|
return;
|
|
600
600
|
const commandObj = {
|
|
601
601
|
data: targetCommand.data,
|
|
@@ -640,7 +640,7 @@ var CommandHandler = class {
|
|
|
640
640
|
client: this.#data.client,
|
|
641
641
|
handler: this.#data.commandkitInstance
|
|
642
642
|
};
|
|
643
|
-
await targetCommand[isAutocomplete ? "
|
|
643
|
+
await targetCommand[isAutocomplete ? "autocomplete" : "run"](context2);
|
|
644
644
|
});
|
|
645
645
|
}
|
|
646
646
|
get commands() {
|
|
@@ -896,7 +896,7 @@ var CommandKit = class {
|
|
|
896
896
|
return [];
|
|
897
897
|
}
|
|
898
898
|
const commands = this.#data.commandHandler.commands.map((cmd) => {
|
|
899
|
-
const { run, ...command } = cmd;
|
|
899
|
+
const { run, autocomplete, ...command } = cmd;
|
|
900
900
|
return command;
|
|
901
901
|
});
|
|
902
902
|
return commands;
|
package/dist/index.mjs
CHANGED
|
@@ -561,8 +561,8 @@ var CommandHandler = class {
|
|
|
561
561
|
);
|
|
562
562
|
if (!targetCommand)
|
|
563
563
|
return;
|
|
564
|
-
const { data, options, run,
|
|
565
|
-
if (isAutocomplete && !
|
|
564
|
+
const { data, options, run, autocomplete, ...rest } = targetCommand;
|
|
565
|
+
if (isAutocomplete && !autocomplete)
|
|
566
566
|
return;
|
|
567
567
|
const commandObj = {
|
|
568
568
|
data: targetCommand.data,
|
|
@@ -607,7 +607,7 @@ var CommandHandler = class {
|
|
|
607
607
|
client: this.#data.client,
|
|
608
608
|
handler: this.#data.commandkitInstance
|
|
609
609
|
};
|
|
610
|
-
await targetCommand[isAutocomplete ? "
|
|
610
|
+
await targetCommand[isAutocomplete ? "autocomplete" : "run"](context2);
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
613
|
get commands() {
|
|
@@ -863,7 +863,7 @@ var CommandKit = class {
|
|
|
863
863
|
return [];
|
|
864
864
|
}
|
|
865
865
|
const commands = this.#data.commandHandler.commands.map((cmd) => {
|
|
866
|
-
const { run, ...command } = cmd;
|
|
866
|
+
const { run, autocomplete, ...command } = cmd;
|
|
867
867
|
return command;
|
|
868
868
|
});
|
|
869
869
|
return commands;
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"bin"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"lint": "tsc",
|
|
23
|
-
"dev": "tsup --watch",
|
|
24
|
-
"build": "tsup",
|
|
25
|
-
"deploy": "npm publish",
|
|
26
|
-
"deploy-dev": "npm publish --access public --tag dev",
|
|
27
|
-
"test": "cd ./tests && node ../bin/index.mjs dev",
|
|
28
|
-
"test:build": "cd ./tests && node ../bin/index.mjs build",
|
|
29
|
-
"test:prod": "cd ./tests && node ../bin/index.mjs start"
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"url": "git+https://github.com/underctrl-io/commandkit.git"
|
|
33
|
-
},
|
|
34
|
-
"homepage": "https://commandkit.js.org",
|
|
35
|
-
"keywords": [
|
|
36
|
-
"discord.js",
|
|
37
|
-
"command handler",
|
|
38
|
-
"event handler"
|
|
39
|
-
],
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"commander": "^11.1.0",
|
|
42
|
-
"dotenv": "^16.3.1",
|
|
43
|
-
"ora": "^7.0.1",
|
|
44
|
-
"rfdc": "^1.3.0",
|
|
45
|
-
"rimraf": "^5.0.5",
|
|
46
|
-
"tsup": "^7.2.0"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/node": "^20.5.9",
|
|
50
|
-
"discord.js": "^14.13.0",
|
|
51
|
-
"tsconfig": "workspace:*",
|
|
52
|
-
"tsx": "^3.12.8",
|
|
53
|
-
"typescript": "^5.1.6"
|
|
54
|
-
},
|
|
55
|
-
"peerDependencies": {
|
|
56
|
-
"discord.js": "^14"
|
|
2
|
+
"name": "commandkit",
|
|
3
|
+
"description": "Beginner friendly command & event handler for Discord.js",
|
|
4
|
+
"version": "0.1.9-dev.20231212192829",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": "./bin/index.mjs",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"require": "./dist/index.js",
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
57
15
|
}
|
|
58
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"bin"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"lint": "tsc",
|
|
23
|
+
"dev": "tsup --watch",
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"deploy": "npm publish",
|
|
26
|
+
"deploy-dev": "npm publish --access public --tag dev",
|
|
27
|
+
"test": "cd ./tests && node ../bin/index.mjs dev",
|
|
28
|
+
"test:build": "cd ./tests && node ../bin/index.mjs build",
|
|
29
|
+
"test:prod": "cd ./tests && node ../bin/index.mjs start"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"url": "git+https://github.com/underctrl-io/commandkit.git"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://commandkit.js.org",
|
|
35
|
+
"keywords": [
|
|
36
|
+
"discord.js",
|
|
37
|
+
"command handler",
|
|
38
|
+
"event handler"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"commander": "^11.1.0",
|
|
42
|
+
"dotenv": "^16.3.1",
|
|
43
|
+
"ora": "^7.0.1",
|
|
44
|
+
"rfdc": "^1.3.0",
|
|
45
|
+
"rimraf": "^5.0.5",
|
|
46
|
+
"tsup": "^7.2.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.5.9",
|
|
50
|
+
"discord.js": "^14.13.0",
|
|
51
|
+
"tsconfig": "workspace:*",
|
|
52
|
+
"tsx": "^3.12.8",
|
|
53
|
+
"typescript": "^5.1.6"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"discord.js": "^14"
|
|
57
|
+
}
|
|
58
|
+
}
|