commandkit 0.0.9 → 0.1.0

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.
Files changed (35) hide show
  1. package/dist/index.d.mts +79 -0
  2. package/dist/index.d.ts +79 -1
  3. package/dist/index.js +652 -15
  4. package/dist/index.mjs +616 -0
  5. package/package.json +29 -5
  6. package/.github/workflows/publish.yaml +0 -26
  7. package/CHANGELOG.md +0 -52
  8. package/dist/CommandKit.d.ts +0 -36
  9. package/dist/CommandKit.js +0 -57
  10. package/dist/handlers/command-handler/CommandHandler.d.ts +0 -12
  11. package/dist/handlers/command-handler/CommandHandler.js +0 -62
  12. package/dist/handlers/command-handler/functions/handleCommands.d.ts +0 -2
  13. package/dist/handlers/command-handler/functions/handleCommands.js +0 -50
  14. package/dist/handlers/command-handler/functions/registerCommands.d.ts +0 -2
  15. package/dist/handlers/command-handler/functions/registerCommands.js +0 -135
  16. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.ts +0 -1
  17. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js +0 -17
  18. package/dist/handlers/command-handler/validations/botPermissions.d.ts +0 -1
  19. package/dist/handlers/command-handler/validations/botPermissions.js +0 -17
  20. package/dist/handlers/command-handler/validations/devOnly.d.ts +0 -1
  21. package/dist/handlers/command-handler/validations/devOnly.js +0 -29
  22. package/dist/handlers/command-handler/validations/guildOnly.d.ts +0 -1
  23. package/dist/handlers/command-handler/validations/guildOnly.js +0 -11
  24. package/dist/handlers/command-handler/validations/userPermissions.d.ts +0 -1
  25. package/dist/handlers/command-handler/validations/userPermissions.js +0 -17
  26. package/dist/handlers/event-handler/EventHandler.d.ts +0 -11
  27. package/dist/handlers/event-handler/EventHandler.js +0 -52
  28. package/dist/handlers/index.d.ts +0 -3
  29. package/dist/handlers/index.js +0 -19
  30. package/dist/handlers/validation-handler/ValidationHandler.d.ts +0 -7
  31. package/dist/handlers/validation-handler/ValidationHandler.js +0 -29
  32. package/dist/utils/get-paths.d.ts +0 -3
  33. package/dist/utils/get-paths.js +0 -42
  34. package/tsconfig.json +0 -14
  35. package/typings.d.ts +0 -63
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getFolderPaths = exports.getFilePaths = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
9
- function getFilePaths(directory, nesting) {
10
- let filePaths = [];
11
- if (!directory)
12
- return filePaths;
13
- const files = fs_1.default.readdirSync(directory, { withFileTypes: true });
14
- for (const file of files) {
15
- const filePath = path_1.default.join(directory, file.name);
16
- if (file.isFile()) {
17
- filePaths.push(filePath);
18
- }
19
- if (nesting && file.isDirectory()) {
20
- filePaths = [...filePaths, ...getFilePaths(filePath, true)];
21
- }
22
- }
23
- return filePaths;
24
- }
25
- exports.getFilePaths = getFilePaths;
26
- function getFolderPaths(directory, nesting) {
27
- let folderPaths = [];
28
- if (!directory)
29
- return folderPaths;
30
- const folders = fs_1.default.readdirSync(directory, { withFileTypes: true });
31
- for (const folder of folders) {
32
- const folderPath = path_1.default.join(directory, folder.name);
33
- if (folder.isDirectory()) {
34
- folderPaths.push(folderPath);
35
- if (nesting) {
36
- folderPaths = [...folderPaths, ...getFolderPaths(folderPath, true)];
37
- }
38
- }
39
- }
40
- return folderPaths;
41
- }
42
- exports.getFolderPaths = getFolderPaths;
package/tsconfig.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "dist",
4
- "strict": true,
5
- "noImplicitAny": true,
6
- "esModuleInterop": true,
7
- "strictNullChecks": true,
8
- "target": "ES2022",
9
- "moduleResolution": "Node",
10
- "module": "CommonJS",
11
- "declaration": true
12
- },
13
- "include": ["src/**/*"]
14
- }
package/typings.d.ts DELETED
@@ -1,63 +0,0 @@
1
- import {
2
- Client,
3
- APIApplicationCommandOption,
4
- ContextMenuCommandType,
5
- Interaction,
6
- PermissionResolvable,
7
- SlashCommandBuilder,
8
- ContextMenuCommandBuilder,
9
- } from 'discord.js';
10
-
11
- export interface CommandKitOptions {
12
- client: Client;
13
- commandsPath?: string;
14
- eventsPath?: string;
15
- validationsPath?: string;
16
- devGuildIds?: string[];
17
- devUserIds?: string[];
18
- devRoleIds?: string[];
19
- skipBuiltInValidations?: boolean;
20
- }
21
-
22
- export interface CommandKitData extends CommandKitOptions {
23
- commands: Array<SlashCommandObject | ContextCommandObject>;
24
- }
25
-
26
- export interface SlashCommandObject {
27
- data:
28
- | SlashCommandBuilder
29
- | {
30
- name: string;
31
- name_localizations?: any;
32
- description: string;
33
- dm_permission?: boolean;
34
- options?: APIApplicationCommandOption[];
35
- };
36
- options?: {
37
- guildOnly?: boolean;
38
- devOnly?: boolean;
39
- deleted?: boolean;
40
- userPermissions?: PermissionResolvable[];
41
- botPermissions?: PermissionResolvable[];
42
- };
43
- run: ({}: { interaction: Interaction; client: Client }) => void;
44
- }
45
-
46
- export interface ContextCommandObject {
47
- data:
48
- | ContextMenuCommandBuilder
49
- | {
50
- name: string;
51
- name_localizations?: any;
52
- type: ContextMenuCommandType;
53
- dm_permission?: boolean;
54
- };
55
- options?: {
56
- guildOnly?: boolean;
57
- devOnly?: boolean;
58
- deleted?: boolean;
59
- userPermissions?: PermissionResolvable[];
60
- botPermissions?: PermissionResolvable[];
61
- };
62
- run: ({}: { interaction: Interaction; client: Client }) => void;
63
- }