@globalart/nestcord 1.7.3 → 1.7.4

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.
@@ -22,6 +22,10 @@ export declare abstract class CommandDiscovery<T extends BaseCommandMeta = BaseC
22
22
  * Returns the command name.
23
23
  */
24
24
  getName(): string;
25
+ /**
26
+ * Get command category
27
+ */
28
+ getCategory(): string | undefined;
25
29
  /**
26
30
  * Sets the command guilds for register.
27
31
  * @param guilds
@@ -36,4 +40,9 @@ export declare abstract class CommandDiscovery<T extends BaseCommandMeta = BaseC
36
40
  * Returns the guilds.
37
41
  */
38
42
  getGuilds(): Snowflake[] | undefined;
43
+ /**
44
+ * Get sub commands
45
+ */
46
+ getSubCommands(): any;
47
+ hasSubCommands(): boolean;
39
48
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommandDiscovery = void 0;
4
+ const discord_js_1 = require("discord.js");
4
5
  const context_1 = require("../context");
5
6
  /**
6
7
  * Represents a command discovery.
@@ -26,6 +27,12 @@ class CommandDiscovery extends context_1.NestCordBaseDiscovery {
26
27
  getName() {
27
28
  return this.meta.name;
28
29
  }
30
+ /**
31
+ * Get command category
32
+ */
33
+ getCategory() {
34
+ return this.meta.category;
35
+ }
29
36
  /**
30
37
  * Sets the command guilds for register.
31
38
  * @param guilds
@@ -47,5 +54,20 @@ class CommandDiscovery extends context_1.NestCordBaseDiscovery {
47
54
  getGuilds() {
48
55
  return this.meta.guilds;
49
56
  }
57
+ /**
58
+ * Get sub commands
59
+ */
60
+ getSubCommands() {
61
+ if (this.isSlashCommand()) {
62
+ return this.subcommands;
63
+ }
64
+ return new discord_js_1.Collection();
65
+ }
66
+ hasSubCommands() {
67
+ if (this.isSlashCommand()) {
68
+ return this.subcommands.size > 0;
69
+ }
70
+ return false;
71
+ }
50
72
  }
51
73
  exports.CommandDiscovery = CommandDiscovery;
@@ -23,7 +23,7 @@ export interface OptionMeta extends APIApplicationCommandOptionBase<ApplicationC
23
23
  * Represents a slash command discovery.
24
24
  */
25
25
  export declare class SlashCommandDiscovery extends CommandDiscovery<SlashCommandMeta> {
26
- private readonly subcommands;
26
+ readonly subcommands: Collection<string, SlashCommandDiscovery>;
27
27
  /**
28
28
  * Returns the command description.
29
29
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalart/nestcord",
3
3
  "description": "A module for creating Discord bots using NestJS, based on Discord.js",
4
- "version": "1.7.3",
4
+ "version": "1.7.4",
5
5
  "private": false,
6
6
  "scripts": {
7
7
  "build": "rimraf dist && tsc -p tsconfig.build.json",
@@ -61,7 +61,7 @@
61
61
  "@nestjs/common": "10.3.9",
62
62
  "@nestjs/core": "10.3.9",
63
63
  "@nestjs/platform-express": "^10.3.8",
64
- "@types/node": "20.14.7",
64
+ "@types/node": "20.14.8",
65
65
  "@typescript-eslint/eslint-plugin": "7.0.0",
66
66
  "@typescript-eslint/parser": "6.21.0",
67
67
  "discord-api-types": "0.37.90",