commandkit 0.1.2 → 0.1.3
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/README.md +9 -7
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +25 -5
- package/dist/index.mjs +25 -5
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
# CommandKit
|
|
7
7
|
|
|
8
|
-
CommandKit is a library that makes it easy to handle commands
|
|
8
|
+
CommandKit is a library that makes it easy to handle commands and events in your Discord.js projects.
|
|
9
9
|
|
|
10
10
|
**Supports Discord.js version 14**
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Features
|
|
13
13
|
|
|
14
14
|
- Very beginner friendly 🚀
|
|
15
15
|
- Support for slash and context menu commands ✅
|
|
@@ -18,11 +18,11 @@ CommandKit is a library that makes it easy to handle commands (+ validations), a
|
|
|
18
18
|
- Supports multiple users as bot developers 👥
|
|
19
19
|
- Object oriented 💻
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
## Documentation
|
|
22
22
|
|
|
23
|
-
You can find the full documentation [here](https://commandkit.
|
|
23
|
+
You can find the full documentation [here](https://commandkit.js.org)
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## Installation
|
|
26
26
|
|
|
27
27
|
[](https://nodei.co/npm/commandkit/)
|
|
28
28
|
|
|
@@ -54,9 +54,11 @@ To install the development version of CommandKit, run the following command:
|
|
|
54
54
|
npm install underctrl-io/commandkit#dev-build
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
> ⚠️ The development version is likely to have bugs.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
This is a simple overview of how to set up this library with all the options. You can read more in the [full documentation](https://commandkit.js.org)
|
|
60
62
|
|
|
61
63
|
```js
|
|
62
64
|
// index.js
|
package/dist/index.d.mts
CHANGED
|
@@ -75,12 +75,20 @@ type CommandObject = Omit<CommandFileObject, 'run'>;
|
|
|
75
75
|
declare class CommandKit {
|
|
76
76
|
#private;
|
|
77
77
|
constructor({ ...options }: CommandKitOptions);
|
|
78
|
-
/**
|
|
79
|
-
* Returns all the commands that CommandKit is handling.
|
|
80
|
-
*
|
|
81
|
-
* @returns An array of command objects
|
|
82
|
-
*/
|
|
78
|
+
/** @returns An array of objects of all the commands that CommandKit is handling. */
|
|
83
79
|
get commands(): CommandObject[];
|
|
80
|
+
/** @returns The path to the commands folder which was set when instantiating CommandKit. */
|
|
81
|
+
get commandsPath(): string | undefined;
|
|
82
|
+
/** @returns The path to the events folder which was set when instantiating CommandKit. */
|
|
83
|
+
get eventsPath(): string | undefined;
|
|
84
|
+
/** @returns The path to the validations folder which was set when instantiating CommandKit. */
|
|
85
|
+
get validationsPath(): string | undefined;
|
|
86
|
+
/** @returns An array of all the developer user IDs which was set when instantiating CommandKit. */
|
|
87
|
+
get devUserIds(): string[];
|
|
88
|
+
/** @returns An array of all the developer guild IDs which was set when instantiating CommandKit. */
|
|
89
|
+
get devGuildIds(): string[];
|
|
90
|
+
/** @returns An array of all the developer role IDs which was set when instantiating CommandKit. */
|
|
91
|
+
get devRoleIds(): string[];
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
export { CommandData, CommandKit, CommandObject, CommandOptions, CommandProps, CommandType, ContextMenuCommandProps, SlashCommandProps, ValidationFunctionProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -75,12 +75,20 @@ type CommandObject = Omit<CommandFileObject, 'run'>;
|
|
|
75
75
|
declare class CommandKit {
|
|
76
76
|
#private;
|
|
77
77
|
constructor({ ...options }: CommandKitOptions);
|
|
78
|
-
/**
|
|
79
|
-
* Returns all the commands that CommandKit is handling.
|
|
80
|
-
*
|
|
81
|
-
* @returns An array of command objects
|
|
82
|
-
*/
|
|
78
|
+
/** @returns An array of objects of all the commands that CommandKit is handling. */
|
|
83
79
|
get commands(): CommandObject[];
|
|
80
|
+
/** @returns The path to the commands folder which was set when instantiating CommandKit. */
|
|
81
|
+
get commandsPath(): string | undefined;
|
|
82
|
+
/** @returns The path to the events folder which was set when instantiating CommandKit. */
|
|
83
|
+
get eventsPath(): string | undefined;
|
|
84
|
+
/** @returns The path to the validations folder which was set when instantiating CommandKit. */
|
|
85
|
+
get validationsPath(): string | undefined;
|
|
86
|
+
/** @returns An array of all the developer user IDs which was set when instantiating CommandKit. */
|
|
87
|
+
get devUserIds(): string[];
|
|
88
|
+
/** @returns An array of all the developer guild IDs which was set when instantiating CommandKit. */
|
|
89
|
+
get devGuildIds(): string[];
|
|
90
|
+
/** @returns An array of all the developer role IDs which was set when instantiating CommandKit. */
|
|
91
|
+
get devRoleIds(): string[];
|
|
84
92
|
}
|
|
85
93
|
|
|
86
94
|
export { CommandData, CommandKit, CommandObject, CommandOptions, CommandProps, CommandType, ContextMenuCommandProps, SlashCommandProps, ValidationFunctionProps };
|
package/dist/index.js
CHANGED
|
@@ -632,11 +632,7 @@ var CommandKit = class {
|
|
|
632
632
|
this.#data.commands = commandHandler.commands;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
/**
|
|
636
|
-
* Returns all the commands that CommandKit is handling.
|
|
637
|
-
*
|
|
638
|
-
* @returns An array of command objects
|
|
639
|
-
*/
|
|
635
|
+
/** @returns An array of objects of all the commands that CommandKit is handling. */
|
|
640
636
|
get commands() {
|
|
641
637
|
const commands = this.#data.commands.map((cmd) => {
|
|
642
638
|
const { run, ...command } = cmd;
|
|
@@ -644,6 +640,30 @@ var CommandKit = class {
|
|
|
644
640
|
});
|
|
645
641
|
return commands;
|
|
646
642
|
}
|
|
643
|
+
/** @returns The path to the commands folder which was set when instantiating CommandKit. */
|
|
644
|
+
get commandsPath() {
|
|
645
|
+
return this.#data.commandsPath;
|
|
646
|
+
}
|
|
647
|
+
/** @returns The path to the events folder which was set when instantiating CommandKit. */
|
|
648
|
+
get eventsPath() {
|
|
649
|
+
return this.#data.eventsPath;
|
|
650
|
+
}
|
|
651
|
+
/** @returns The path to the validations folder which was set when instantiating CommandKit. */
|
|
652
|
+
get validationsPath() {
|
|
653
|
+
return this.#data.validationsPath;
|
|
654
|
+
}
|
|
655
|
+
/** @returns An array of all the developer user IDs which was set when instantiating CommandKit. */
|
|
656
|
+
get devUserIds() {
|
|
657
|
+
return this.#data.devUserIds || [];
|
|
658
|
+
}
|
|
659
|
+
/** @returns An array of all the developer guild IDs which was set when instantiating CommandKit. */
|
|
660
|
+
get devGuildIds() {
|
|
661
|
+
return this.#data.devGuildIds || [];
|
|
662
|
+
}
|
|
663
|
+
/** @returns An array of all the developer role IDs which was set when instantiating CommandKit. */
|
|
664
|
+
get devRoleIds() {
|
|
665
|
+
return this.#data.devRoleIds || [];
|
|
666
|
+
}
|
|
647
667
|
};
|
|
648
668
|
|
|
649
669
|
// src/types/index.ts
|
package/dist/index.mjs
CHANGED
|
@@ -595,11 +595,7 @@ var CommandKit = class {
|
|
|
595
595
|
this.#data.commands = commandHandler.commands;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
/**
|
|
599
|
-
* Returns all the commands that CommandKit is handling.
|
|
600
|
-
*
|
|
601
|
-
* @returns An array of command objects
|
|
602
|
-
*/
|
|
598
|
+
/** @returns An array of objects of all the commands that CommandKit is handling. */
|
|
603
599
|
get commands() {
|
|
604
600
|
const commands = this.#data.commands.map((cmd) => {
|
|
605
601
|
const { run, ...command } = cmd;
|
|
@@ -607,6 +603,30 @@ var CommandKit = class {
|
|
|
607
603
|
});
|
|
608
604
|
return commands;
|
|
609
605
|
}
|
|
606
|
+
/** @returns The path to the commands folder which was set when instantiating CommandKit. */
|
|
607
|
+
get commandsPath() {
|
|
608
|
+
return this.#data.commandsPath;
|
|
609
|
+
}
|
|
610
|
+
/** @returns The path to the events folder which was set when instantiating CommandKit. */
|
|
611
|
+
get eventsPath() {
|
|
612
|
+
return this.#data.eventsPath;
|
|
613
|
+
}
|
|
614
|
+
/** @returns The path to the validations folder which was set when instantiating CommandKit. */
|
|
615
|
+
get validationsPath() {
|
|
616
|
+
return this.#data.validationsPath;
|
|
617
|
+
}
|
|
618
|
+
/** @returns An array of all the developer user IDs which was set when instantiating CommandKit. */
|
|
619
|
+
get devUserIds() {
|
|
620
|
+
return this.#data.devUserIds || [];
|
|
621
|
+
}
|
|
622
|
+
/** @returns An array of all the developer guild IDs which was set when instantiating CommandKit. */
|
|
623
|
+
get devGuildIds() {
|
|
624
|
+
return this.#data.devGuildIds || [];
|
|
625
|
+
}
|
|
626
|
+
/** @returns An array of all the developer role IDs which was set when instantiating CommandKit. */
|
|
627
|
+
get devRoleIds() {
|
|
628
|
+
return this.#data.devRoleIds || [];
|
|
629
|
+
}
|
|
610
630
|
};
|
|
611
631
|
|
|
612
632
|
// src/types/index.ts
|