commandkit 0.1.4 → 0.1.5-dev.20231004064050

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.js CHANGED
@@ -128,6 +128,7 @@ async function loadCommandsWithRest(props) {
128
128
  }
129
129
  }
130
130
  async function handleLoading(client, commands, devGuildIds, reloading, type) {
131
+ commands = commands.filter((cmd) => !cmd.options?.deleted);
131
132
  const devOnlyCommands = commands.filter((cmd) => cmd.options?.devOnly);
132
133
  const globalCommands = commands.filter((cmd) => !cmd.options?.devOnly);
133
134
  if (type === "dev") {
@@ -511,6 +512,15 @@ var CommandHandler = class {
511
512
  const modulePath = toFileURL(commandFilePath);
512
513
  let importedObj = await import(`${modulePath}?t=${Date.now()}`);
513
514
  let commandObj = clone(importedObj);
515
+ if (importedObj.default) {
516
+ commandObj.data = importedObj.default.data;
517
+ } else {
518
+ commandObj.data = importedObj.data;
519
+ }
520
+ try {
521
+ commandObj.data = commandObj.data.toJSON();
522
+ } catch (error) {
523
+ }
514
524
  if (typeof module !== "undefined" && typeof require !== "undefined") {
515
525
  delete require.cache[require.resolve(commandFilePath)];
516
526
  }
package/dist/index.mjs CHANGED
@@ -98,6 +98,7 @@ async function loadCommandsWithRest(props) {
98
98
  }
99
99
  }
100
100
  async function handleLoading(client, commands, devGuildIds, reloading, type) {
101
+ commands = commands.filter((cmd) => !cmd.options?.deleted);
101
102
  const devOnlyCommands = commands.filter((cmd) => cmd.options?.devOnly);
102
103
  const globalCommands = commands.filter((cmd) => !cmd.options?.devOnly);
103
104
  if (type === "dev") {
@@ -481,6 +482,15 @@ var CommandHandler = class {
481
482
  const modulePath = toFileURL(commandFilePath);
482
483
  let importedObj = await import(`${modulePath}?t=${Date.now()}`);
483
484
  let commandObj = clone(importedObj);
485
+ if (importedObj.default) {
486
+ commandObj.data = importedObj.default.data;
487
+ } else {
488
+ commandObj.data = importedObj.data;
489
+ }
490
+ try {
491
+ commandObj.data = commandObj.data.toJSON();
492
+ } catch (error) {
493
+ }
484
494
  if (typeof module !== "undefined" && typeof __require !== "undefined") {
485
495
  delete __require.cache[__require.resolve(commandFilePath)];
486
496
  }
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
1
  {
2
- "name": "commandkit",
3
- "description": "Beginner friendly command & event handler for Discord.js",
4
- "version": "0.1.4",
5
- "license": "MIT",
6
- "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
- "types": "./dist/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "require": "./dist/index.js",
12
- "import": "./dist/index.mjs",
13
- "types": "./dist/index.d.ts"
14
- }
15
- },
16
- "scripts": {
17
- "lint": "tsc",
18
- "dev": "tsup --watch",
19
- "build": "tsup",
20
- "deploy": "npm publish",
21
- "deploy-dev": "npm publish --access public --tag dev",
22
- "test": "tsx tests/index.ts",
23
- "test:watch": "tsx watch tests/index.ts"
24
- },
25
- "repository": {
26
- "url": "git+https://github.com/underctrl-io/commandkit.git"
27
- },
28
- "homepage": "https://commandkit.js.org",
29
- "keywords": [
30
- "discord.js",
31
- "command handler",
32
- "event handler"
33
- ],
34
- "dependencies": {
35
- "rfdc": "^1.3.0"
36
- },
37
- "devDependencies": {
38
- "@types/node": "^20.5.9",
39
- "discord.js": "^14.13.0",
40
- "dotenv": "^16.3.1",
41
- "tsconfig": "workspace:*",
42
- "tsup": "^7.2.0",
43
- "tsx": "^3.12.8",
44
- "typescript": "^5.1.6"
45
- },
46
- "peerDependencies": {
47
- "discord.js": "^14"
2
+ "name": "commandkit",
3
+ "description": "Beginner friendly command & event handler for Discord.js",
4
+ "version": "0.1.5-dev.20231004064050",
5
+ "license": "MIT",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "require": "./dist/index.js",
12
+ "import": "./dist/index.mjs",
13
+ "types": "./dist/index.d.ts"
48
14
  }
49
- }
15
+ },
16
+ "scripts": {
17
+ "lint": "tsc",
18
+ "dev": "tsup --watch",
19
+ "build": "tsup",
20
+ "deploy": "npm publish",
21
+ "deploy-dev": "npm publish --access public --tag dev",
22
+ "test": "tsx tests/index.ts",
23
+ "test:watch": "tsx watch tests/index.ts"
24
+ },
25
+ "repository": {
26
+ "url": "git+https://github.com/underctrl-io/commandkit.git"
27
+ },
28
+ "homepage": "https://commandkit.js.org",
29
+ "keywords": [
30
+ "discord.js",
31
+ "command handler",
32
+ "event handler"
33
+ ],
34
+ "dependencies": {
35
+ "rfdc": "^1.3.0"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^20.5.9",
39
+ "discord.js": "^14.13.0",
40
+ "dotenv": "^16.3.1",
41
+ "tsconfig": "workspace:*",
42
+ "tsup": "^7.2.0",
43
+ "tsx": "^3.12.8",
44
+ "typescript": "^5.1.6"
45
+ },
46
+ "peerDependencies": {
47
+ "discord.js": "^14"
48
+ }
49
+ }