commandkit 0.0.8 → 0.0.10

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 CHANGED
@@ -1,17 +1,17 @@
1
1
  # CommandKit
2
2
 
3
- CommandKit is a library that makes it easy to handle commands (+validations), and events in your Discord.js projects.
3
+ CommandKit is a library that makes it easy to handle commands (+ validations), and events in your Discord.js projects.
4
4
 
5
- _Tested with Discord.js version `v14.11.0`_
5
+ **Supports Discord.js version 14**
6
6
 
7
7
  # Features
8
8
 
9
- - Very beginner friendly 🚀
10
- - Support for slash and context menu commands ✅
11
- - Automatic command registration, edits, and deletion 🤖
12
- - Supports multiple development servers 🤝
13
- - Supports multiple users as bot developers 👥
14
- - Object oriented 💻
9
+ - Very beginner friendly 🚀
10
+ - Support for slash and context menu commands ✅
11
+ - Automatic command registration, edits, and deletion 🤖
12
+ - Supports multiple development servers 🤝
13
+ - Supports multiple users as bot developers 👥
14
+ - Object oriented 💻
15
15
 
16
16
  # Documentation
17
17
 
@@ -37,38 +37,46 @@ yarn add commandkit
37
37
 
38
38
  # Usage
39
39
 
40
- This is a simple overview of how to set up this library with all the options.
41
-
42
- **It's highly recommended you check out the [documentation](https://commandkit.underctrl.io) to fully understand how to work with this library.**
40
+ 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.underctrl.io)
43
41
 
44
42
  ```js
45
43
  // index.js
46
- const { Client, IntentsBitField } = require('discord.js');
44
+ const { Client, GatewayIntentBits } = require('discord.js');
47
45
  const { CommandKit } = require('commandkit');
48
46
  const path = require('path');
49
47
 
50
48
  const client = new Client({
51
- intents: [IntentsBitField.Flags.Guilds],
49
+ intents: [
50
+ GatewayIntentBits.Guilds,
51
+ GatewayIntentBits.GuildMessages,
52
+ GatewayIntentBits.MessageContent,
53
+ ],
52
54
  });
53
55
 
54
56
  new CommandKit({
55
- // Your discord.js client object
56
- client,
57
+ // Your discord.js client object
58
+ client,
59
+
60
+ // Path to the commands folder
61
+ commandsPath: path.join(__dirname, 'commands'),
62
+
63
+ // Path to the events folder
64
+ eventsPath: path.join(__dirname, 'events'),
57
65
 
58
- // Path to the commands folder
59
- commandsPath: path.join(__dirname, 'commands'),
66
+ // Path to the validations folder (only valid if "commandsPath" was provided)
67
+ validationsPath: path.join(__dirname, 'validations'),
60
68
 
61
- // Path to the events folder
62
- eventsPath: path.join(__dirname, 'events'),
69
+ // Array of development server IDs (used to register and run devOnly commands)
70
+ devGuildIds: ['DEV_SERVER_ID_1', 'DEV_SERVER_ID_2'],
63
71
 
64
- // Path to the validations folder (only valid if "commandsPath" was provided)
65
- validationsPath: path.join(__dirname, 'validations'),
72
+ // Array of developer user IDs (used for devOnly commands)
73
+ devUserIds: ['DEV_USER_ID_1', 'DEV_USER_ID_2'],
66
74
 
67
- // Array of development server IDs (used to register and run devOnly commands)
68
- devGuildIds: ['DEV_SERVER_ID_1', 'DEV_SERVER_ID_2'],
75
+ // Array of developer role IDs (used for devOnly commands)
76
+ devRoleIds: ['DEV_ROLE_ID_1', 'DEV_ROLE_ID_2'],
69
77
 
70
- // Array of developer user IDs (used for devOnly commands)
71
- devUserIds: ['DEV_USER_ID_1', 'DEV_USER_ID_2'],
78
+ // A property that disables CommandKit's built-in validations
79
+ skipBuiltInValidations: true,
72
80
  });
73
81
 
74
82
  client.login('YOUR_TOKEN_HERE');
@@ -0,0 +1,51 @@
1
+ import * as discord_js from 'discord.js';
2
+ import { Client } from 'discord.js';
3
+ import * as _discordjs_builders from '@discordjs/builders';
4
+
5
+ interface CommandKitOptions {
6
+ client: Client;
7
+ commandsPath?: string;
8
+ eventsPath?: string;
9
+ validationsPath?: string;
10
+ devGuildIds?: string[];
11
+ devUserIds?: string[];
12
+ devRoleIds?: string[];
13
+ skipBuiltInValidations?: boolean;
14
+ }
15
+
16
+ declare class CommandKit {
17
+ #private;
18
+ constructor({ ...options }: CommandKitOptions);
19
+ get commands(): ({
20
+ data: _discordjs_builders.SlashCommandBuilder | {
21
+ name: string;
22
+ name_localizations?: any;
23
+ description: string;
24
+ dm_permission?: boolean | undefined;
25
+ options?: discord_js.APIApplicationCommandOption[] | undefined;
26
+ };
27
+ options?: {
28
+ guildOnly?: boolean | undefined;
29
+ devOnly?: boolean | undefined;
30
+ deleted?: boolean | undefined;
31
+ userPermissions?: discord_js.PermissionResolvable[] | undefined;
32
+ botPermissions?: discord_js.PermissionResolvable[] | undefined;
33
+ } | undefined;
34
+ } | {
35
+ data: _discordjs_builders.ContextMenuCommandBuilder | {
36
+ name: string;
37
+ name_localizations?: any;
38
+ type: _discordjs_builders.ContextMenuCommandType;
39
+ dm_permission?: boolean | undefined;
40
+ };
41
+ options?: {
42
+ guildOnly?: boolean | undefined;
43
+ devOnly?: boolean | undefined;
44
+ deleted?: boolean | undefined;
45
+ userPermissions?: discord_js.PermissionResolvable[] | undefined;
46
+ botPermissions?: discord_js.PermissionResolvable[] | undefined;
47
+ } | undefined;
48
+ })[];
49
+ }
50
+
51
+ export { CommandKit };
package/dist/index.d.ts CHANGED
@@ -1 +1,51 @@
1
- export * from './CommandKit';
1
+ import * as discord_js from 'discord.js';
2
+ import { Client } from 'discord.js';
3
+ import * as _discordjs_builders from '@discordjs/builders';
4
+
5
+ interface CommandKitOptions {
6
+ client: Client;
7
+ commandsPath?: string;
8
+ eventsPath?: string;
9
+ validationsPath?: string;
10
+ devGuildIds?: string[];
11
+ devUserIds?: string[];
12
+ devRoleIds?: string[];
13
+ skipBuiltInValidations?: boolean;
14
+ }
15
+
16
+ declare class CommandKit {
17
+ #private;
18
+ constructor({ ...options }: CommandKitOptions);
19
+ get commands(): ({
20
+ data: _discordjs_builders.SlashCommandBuilder | {
21
+ name: string;
22
+ name_localizations?: any;
23
+ description: string;
24
+ dm_permission?: boolean | undefined;
25
+ options?: discord_js.APIApplicationCommandOption[] | undefined;
26
+ };
27
+ options?: {
28
+ guildOnly?: boolean | undefined;
29
+ devOnly?: boolean | undefined;
30
+ deleted?: boolean | undefined;
31
+ userPermissions?: discord_js.PermissionResolvable[] | undefined;
32
+ botPermissions?: discord_js.PermissionResolvable[] | undefined;
33
+ } | undefined;
34
+ } | {
35
+ data: _discordjs_builders.ContextMenuCommandBuilder | {
36
+ name: string;
37
+ name_localizations?: any;
38
+ type: _discordjs_builders.ContextMenuCommandType;
39
+ dm_permission?: boolean | undefined;
40
+ };
41
+ options?: {
42
+ guildOnly?: boolean | undefined;
43
+ devOnly?: boolean | undefined;
44
+ deleted?: boolean | undefined;
45
+ userPermissions?: discord_js.PermissionResolvable[] | undefined;
46
+ botPermissions?: discord_js.PermissionResolvable[] | undefined;
47
+ } | undefined;
48
+ })[];
49
+ }
50
+
51
+ export { CommandKit };