trivious 2.0.0 → 2.0.2

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 (29) hide show
  1. package/README.md +4 -2
  2. package/dist/features/client/client.types.d.ts +1 -1
  3. package/dist/features/client/deploy.client.d.ts +1 -1
  4. package/dist/features/client/deploy.client.js +2 -2
  5. package/dist/features/client/deploy.client.js.map +1 -1
  6. package/dist/features/client/trivious.client.d.ts +1 -1
  7. package/dist/features/client/trivious.client.js +2 -3
  8. package/dist/features/client/trivious.client.js.map +1 -1
  9. package/dist/features/commands/commands.types.d.ts +1 -1
  10. package/dist/features/commands/methods.commands.d.ts +2 -2
  11. package/dist/features/commands/registry.commands.d.ts +1 -1
  12. package/dist/features/commands/registry.commands.js +8 -2
  13. package/dist/features/commands/registry.commands.js.map +1 -1
  14. package/dist/features/components/components.types.d.ts +1 -1
  15. package/dist/features/components/registry.components.d.ts +1 -1
  16. package/dist/features/customId/customid.types.d.ts +1 -1
  17. package/dist/features/customId/methods.customid.d.ts +1 -1
  18. package/dist/features/events/events.types.d.ts +1 -1
  19. package/dist/features/events/presets/clientReady.d.ts +1 -1
  20. package/dist/features/events/presets/interactionCreate.d.ts +1 -1
  21. package/dist/features/events/registry.events.d.ts +1 -1
  22. package/dist/features/modules/modules.types.d.ts +1 -1
  23. package/dist/features/modules/registry.modules.d.ts +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/{modules.types-Bn4HfuVk.d.ts → modules.types-uNvWKT4j.d.ts} +7 -8
  26. package/dist/shared/registries.d.ts +1 -1
  27. package/dist/shared/typings.d.ts +1 -1
  28. package/dist/utility/errors.d.ts +1 -1
  29. package/package.json +1 -1
package/README.md CHANGED
@@ -62,12 +62,13 @@ These default events can be found in `src/features/events/presets` in the Trivio
62
62
 
63
63
  ```ts
64
64
  // commands/debug/index.ts
65
- import { SlashCommandBuilder } from "discord.js";
65
+ import { ApplicationCommandType, SlashCommandBuilder } from "discord.js";
66
66
  import { SlashCommandData } from "trivious";
67
67
 
68
68
  export default {
69
69
  active: true,
70
70
  context: "SlashCommand",
71
+ commandType: ApplicationCommandType.ChatInput,
71
72
  flags: ["Cached", "EphemeralReply", "DeferReply"],
72
73
  data: new SlashCommandBuilder().setName("debug").setDescription("Debug commands"),
73
74
  } satisfies SlashCommandData;
@@ -97,12 +98,13 @@ export default {
97
98
 
98
99
  ```ts
99
100
  // commands/debug/ping.ts
100
- import { SlashCommandSubcommandBuilder } from "discord.js";
101
+ import { ApplicationCommandType, SlashCommandSubcommandBuilder } from "discord.js";
101
102
  import { interactionReply, SlashSubcommandData } from "trivious";
102
103
 
103
104
  export default {
104
105
  active: true,
105
106
  context: "SlashSubcommand",
107
+ commandType: ApplicationCommandType.ChatInput,
106
108
  data: new SlashCommandSubcommandBuilder().setName("ping").setDescription("Ping pong!"),
107
109
 
108
110
  async execute(client, interaction) {
@@ -7,7 +7,7 @@ import { ClientOptions } from 'discord.js';
7
7
  * @param clientId Environment variable name for bot client ID
8
8
  */
9
9
  interface TriviousClientCredentials {
10
- tokenRefernece: string;
10
+ tokenReference: string;
11
11
  clientIdReference: string;
12
12
  }
13
13
  /**
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import './client.types.js';
4
4
 
@@ -1,13 +1,13 @@
1
1
  import { createHash } from 'crypto';
2
+ import { REST, Routes } from 'discord.js';
2
3
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
3
4
  import { join, dirname } from 'path';
4
- import { REST, Routes } from 'discord.js';
5
5
  import { TriviousError } from '../../utility/errors.js';
6
6
 
7
7
  async function commandDeploy(client) {
8
8
  const { commandHashConfig } = client.trivious;
9
9
  const clientId = process.env[client.trivious.credentials.clientIdReference];
10
- const token = process.env[client.trivious.credentials.tokenRefernece];
10
+ const token = process.env[client.trivious.credentials.tokenReference];
11
11
  if (!clientId || !token)
12
12
  throw new TriviousError("Invalid clientId or token environment variable");
13
13
  const commands = client.stores.commands;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/client/deploy.client.ts"],"names":[],"mappings":";;;;;;AAQA,eAAO,cAAqC,MAAA,EAAwB;AACnE,EAAA,MAAM,EAAE,iBAAA,EAAkB,GAAI,MAAA,CAAO,QAAA;AAErC,EAAA,MAAM,WAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,QAAA,CAAS,YAAY,iBAAiB,CAAA;AAC1E,EAAA,MAAM,QAAQ,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,QAAA,CAAS,YAAY,cAAc,CAAA;AACpE,EAAA,IAAI,CAAC,YAAY,CAAC,KAAA;AACjB,IAAA,MAAM,IAAI,cAAc,gDAAgD,CAAA;AAEzE,EAAA,MAAM,QAAA,GAAW,OAAO,MAAA,CAAO,QAAA;AAC/B,EAAA,MAAM,IAAA,GAAO;AAAA,IACZ,GAAG,SAAS,SAAA,CAAU,GAAA,CAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,IAAA,CAAK,MAAA,EAAQ,CAAA;AAAA,IAC5D,GAAG,SAAS,OAAA,CAAQ,GAAA;AAAA,MAAI,CAAC,OAAA,KACvB,OAAA,CAAiD,IAAA,CAAK,MAAA;AAAO;AAC/D,GACD;AAEA,EAAA,IAAI,iBAAA,IAAqB,kBAAkB,OAAA,EAAS;AACnD,IAAA,MAAM,QAAA,GAAW,IAAA,CAAK,iBAAA,CAAkB,kBAAA,IAAsB,QAAQ,eAAe,CAAA;AACrF,IAAA,MAAM,OAAA,GAAU,UAAA,CAAW,QAAQ,CAAA,CACjC,MAAA,CAAO,KAAK,SAAA,CAAU,IAAA,CAAK,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM,EAAE,IAAA,CAAK,aAAA,CAAc,CAAA,CAAE,IAAI,CAAC,CAAC,EAAE,QAAA,EAAU,CAAA,CACnF,MAAA,CAAO,KAAK,CAAA;AAEd,IAAA,IAAI,OAAA,GAAU,EAAA;AACd,IAAA,IAAI,WAAW,QAAQ,CAAA,EAAG,OAAA,GAAU,YAAA,CAAa,UAAU,OAAO,CAAA;AAElE,IAAA,IAAI,YAAY,OAAA,EAAS;AACxB,MAAA,OAAA,CAAQ,MAAM,CAAA,6DAAA,CAA+D,CAAA;AAC7E,MAAA;AAAA,IACD;AAEA,IAAA,MAAM,aAAA,GAAgB,QAAQ,QAAQ,CAAA;AACtC,IAAA,IAAI,CAAC,UAAA,CAAW,aAAa,CAAA,EAAG;AAC/B,MAAA,SAAA,CAAU,aAAA,EAAe,EAAE,SAAA,EAAW,IAAA,EAAM,CAAA;AAAA,IAC7C;AAEA,IAAA,aAAA,CAAc,QAAA,EAAU,OAAA,EAAS,EAAE,QAAA,EAAU,SAAS,CAAA;AACtD,IAAA,OAAA,CAAQ,KAAA,CAAM,CAAA,qCAAA,EAAwC,QAAQ,CAAA,CAAE,CAAA;AAAA,EACjE;AAEA,EAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,EAAE,SAAS,IAAA,EAAM,CAAA,CAAE,QAAA,CAAS,KAAK,CAAA;AACvD,EAAA,MAAM,IAAA,CAAK,IAAI,MAAA,CAAO,mBAAA,CAAoB,QAAQ,CAAA,EAAG,EAAE,MAAM,CAAA;AAC7D,EAAA,OAAA,CAAQ,KAAA,CAAM,CAAA,oBAAA,EAAuB,IAAA,CAAK,MAAM,CAAA,SAAA,CAAW,CAAA;AAC5D","file":"deploy.client.js","sourcesContent":["import { createHash } from \"crypto\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport { REST, Routes } from \"discord.js\";\nimport { TriviousError } from \"src/utility/errors.js\";\nimport { MessageCommandData, UserCommandData } from \"../commands/commands.types.js\";\nimport TriviousClient from \"./trivious.client.js\";\n\nexport default async function commandDeploy(client: TriviousClient) {\n\tconst { commandHashConfig } = client.trivious;\n\n\tconst clientId = process.env[client.trivious.credentials.clientIdReference];\n\tconst token = process.env[client.trivious.credentials.tokenRefernece];\n\tif (!clientId || !token)\n\t\tthrow new TriviousError(\"Invalid clientId or token environment variable\");\n\n\tconst commands = client.stores.commands;\n\tconst body = [\n\t\t...commands.chatInput.map((command) => command.data.toJSON()),\n\t\t...commands.context.map((command) =>\n\t\t\t(command as UserCommandData | MessageCommandData).data.toJSON()\n\t\t),\n\t];\n\n\tif (commandHashConfig && commandHashConfig.enabled) {\n\t\tconst hashFile = join(commandHashConfig.persistentDataPath || \"data\", \"commands.hash\");\n\t\tconst newHash = createHash(\"sha256\")\n\t\t\t.update(JSON.stringify(body.sort((a, b) => a.name.localeCompare(b.name))).toString())\n\t\t\t.digest(\"hex\");\n\n\t\tlet oldHash = \"\";\n\t\tif (existsSync(hashFile)) oldHash = readFileSync(hashFile, \"utf-8\");\n\n\t\tif (newHash === oldHash) {\n\t\t\tconsole.debug(`[Trivious] No changes in commands found, skipping deployment.`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst hashDirectory = dirname(hashFile);\n\t\tif (!existsSync(hashDirectory)) {\n\t\t\tmkdirSync(hashDirectory, { recursive: true });\n\t\t}\n\n\t\twriteFileSync(hashFile, newHash, { encoding: \"utf-8\" });\n\t\tconsole.debug(`[Trivious] Created new command hash: ${hashFile}`);\n\t}\n\n\tconst rest = new REST({ version: \"10\" }).setToken(token);\n\tawait rest.put(Routes.applicationCommands(clientId), { body });\n\tconsole.debug(`[Trivious] Deployed ${body.length} commands`);\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/client/deploy.client.ts"],"names":[],"mappings":";;;;;;AAQA,eAAO,cAAqC,MAAA,EAAwB;AACnE,EAAA,MAAM,EAAE,iBAAA,EAAkB,GAAI,MAAA,CAAO,QAAA;AAErC,EAAA,MAAM,WAAW,OAAA,CAAQ,GAAA,CAAI,MAAA,CAAO,QAAA,CAAS,YAAY,iBAAiB,CAAA;AAC1E,EAAA,MAAM,QAAQ,OAAA,CAA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CAAU,aAAA,EAAe,EAAE,SAAA,EAAW,IAAA,EAAM,CAAA;AAAA,IAC7C;AAEA,IAAA,aAAA,CAAc,QAAA,EAAU,OAAA,EAAS,EAAE,QAAA,EAAU,SAAS,CAAA;AACtD,IAAA,OAAA,CAAQ,KAAA,CAAM,CAAA,qCAAA,EAAwC,QAAQ,CAAA,CAAE,CAAA;AAAA,EACjE;AAEA,EAAA,MAAM,IAAA,GAAO,IAAI,IAAA,CAAK,EAAE,SAAS,IAAA,EAAM,CAAA,CAAE,QAAA,CAAS,KAAK,CAAA;AACvD,EAAA,MAAM,IAAA,CAAK,IAAI,MAAA,CAAO,mBAAA,CAAoB,QAAQ,CAAA,EAAG,EAAE,MAAM,CAAA;AAC7D,EAAA,OAAA,CAAQ,KAAA,CAAM,CAAA,oBAAA,EAAuB,IAAA,CAAK,MAAM,CAAA,SAAA,CAAW,CAAA;AAC5D","file":"deploy.client.js","sourcesContent":["import { createHash } from \"crypto\";\nimport { REST, Routes } from \"discord.js\";\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport { TriviousError } from \"src/utility/errors.js\";\nimport { MessageCommandData, UserCommandData } from \"../commands/commands.types.js\";\nimport TriviousClient from \"./trivious.client.js\";\n\nexport default async function commandDeploy(client: TriviousClient) {\n\tconst { commandHashConfig } = client.trivious;\n\n\tconst clientId = process.env[client.trivious.credentials.clientIdReference];\n\tconst token = process.env[client.trivious.credentials.tokenReference];\n\tif (!clientId || !token)\n\t\tthrow new TriviousError(\"Invalid clientId or token environment variable\");\n\n\tconst commands = client.stores.commands;\n\tconst body = [\n\t\t...commands.chatInput.map((command) => command.data.toJSON()),\n\t\t...commands.context.map((command) =>\n\t\t\t(command as UserCommandData | MessageCommandData).data.toJSON()\n\t\t),\n\t];\n\n\tif (commandHashConfig && commandHashConfig.enabled) {\n\t\tconst hashFile = join(commandHashConfig.persistentDataPath || \"data\", \"commands.hash\");\n\t\tconst newHash = createHash(\"sha256\")\n\t\t\t.update(JSON.stringify(body.sort((a, b) => a.name.localeCompare(b.name))).toString())\n\t\t\t.digest(\"hex\");\n\n\t\tlet oldHash = \"\";\n\t\tif (existsSync(hashFile)) oldHash = readFileSync(hashFile, \"utf-8\");\n\n\t\tif (newHash === oldHash) {\n\t\t\tconsole.debug(`[Trivious] No changes in commands found, skipping deployment.`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst hashDirectory = dirname(hashFile);\n\t\tif (!existsSync(hashDirectory)) {\n\t\t\tmkdirSync(hashDirectory, { recursive: true });\n\t\t}\n\n\t\twriteFileSync(hashFile, newHash, { encoding: \"utf-8\" });\n\t\tconsole.debug(`[Trivious] Created new command hash: ${hashFile}`);\n\t}\n\n\tconst rest = new REST({ version: \"10\" }).setToken(token);\n\tawait rest.put(Routes.applicationCommands(clientId), { body });\n\tconsole.debug(`[Trivious] Deployed ${body.length} commands`);\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
2
  import './client.types.js';
3
- export { T as default } from '../../modules.types-Bn4HfuVk.js';
3
+ export { T as default } from '../../modules.types-uNvWKT4j.js';
@@ -26,10 +26,10 @@ class TriviousClient extends Client {
26
26
  * @throws {TriviousError} If invalid bot token
27
27
  */
28
28
  async start() {
29
- const token = process.env[this.trivious.credentials.tokenRefernece];
29
+ const token = process.env[this.trivious.credentials.tokenReference];
30
30
  if (!token) {
31
31
  throw new TriviousError(
32
- `Bot token environment variable '${this.trivious.credentials.tokenRefernece}' does not exist!`,
32
+ `Bot token environment variable '${this.trivious.credentials.tokenReference}' does not exist!`,
33
33
  "Null environment variable"
34
34
  );
35
35
  }
@@ -50,7 +50,6 @@ class TriviousClient extends Client {
50
50
  await registries.modules.register(this, dir);
51
51
  await registries.commands.register(this, dir);
52
52
  await registries.components.register(this, dir);
53
- console.log(this.stores);
54
53
  }
55
54
  async deploy() {
56
55
  await commandDeploy(this);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/client/trivious.client.ts"],"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AAA,MAAM,IAAA,CAAK,MAAM,KAAK,CAAA;AAAA,EACvB;AAAA,EAEA,MAAM,QAAA,GAAW;AAChB,IAAA,MAAM,GAAA,GAAM,SAAA,CAAU,mBAAA,CAAoB,IAAA,CAAK,SAAS,QAAQ,CAAA;AAEhE,IAAA,MAAM,UAAA,CAAW,MAAA,CAAO,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAC1C,IAAA,MAAM,UAAA,CAAW,OAAA,CAAQ,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAC3C,IAAA,MAAM,UAAA,CAAW,QAAA,CAAS,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAC5C,IAAA,MAAM,UAAA,CAAW,UAAA,CAAW,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAE9C,IAAA,OAAA,CAAQ,GAAA,CAAI,KAAK,MAAM,CAAA;AAAA,EACxB;AAAA,EAEA,MAAM,MAAA,GAAS;AACd,IAAA,MAAM,cAAc,IAAI,CAAA;AAAA,EACzB;AACD","file":"trivious.client.js","sourcesContent":["import { Client, Collection } from \"discord.js\";\nimport registries from \"src/shared/registries.js\";\nimport structure from \"../structure/index.structure.js\";\n\nimport type {\n\tBaseContextCommandData,\n\tComponent,\n\tEvent,\n\tModule,\n\tSlashCommandData,\n\tTriviousClientOptions,\n} from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport commandDeploy from \"./deploy.client.js\";\n\nexport default class TriviousClient extends Client {\n\ttrivious: TriviousClientOptions;\n\treadonly stores: {\n\t\tcommands: {\n\t\t\tchatInput: Collection<string, SlashCommandData>;\n\t\t\tcontext: Collection<string, BaseContextCommandData>;\n\t\t};\n\t\tcomponents: Collection<string, Component>;\n\t\tevents: Collection<string, Event>;\n\t\tmodules: Collection<string, Module>;\n\t};\n\n\tconstructor(options: TriviousClientOptions) {\n\t\tsuper(options);\n\t\tthis.trivious = options;\n\n\t\tthis.stores = {\n\t\t\tcommands: {\n\t\t\t\tchatInput: new Collection(),\n\t\t\t\tcontext: new Collection(),\n\t\t\t},\n\t\t\tcomponents: new Collection(),\n\t\t\tevents: new Collection(),\n\t\t\tmodules: new Collection(),\n\t\t};\n\t}\n\n\t/**\n\t * Register, deploy and log into the bot.\n\t *\n\t * @throws {TriviousError} If invalid bot token\n\t */\n\tasync start() {\n\t\tconst token = process.env[this.trivious.credentials.tokenRefernece];\n\t\tif (!token) {\n\t\t\tthrow new TriviousError(\n\t\t\t\t`Bot token environment variable '${this.trivious.credentials.tokenRefernece}' does not exist!`,\n\t\t\t\t\"Null environment variable\"\n\t\t\t);\n\t\t}\n\n\t\tawait this.register();\n\t\tawait this.deploy();\n\n\t\ttry {\n\t\t\tawait registries.events.bind(this);\n\t\t\tawait registries.modules.bind(this);\n\t\t} catch (err: any) {\n\t\t\tconst error = new TriviousError(err.message, \"Error during events and modules binds\");\n\t\t\tconsole.error(error);\n\t\t}\n\n\t\tawait this.login(token);\n\t}\n\n\tasync register() {\n\t\tconst dir = structure.resolveRelativePath(this.trivious.corePath);\n\n\t\tawait registries.events.register(this, dir);\n\t\tawait registries.modules.register(this, dir);\n\t\tawait registries.commands.register(this, dir);\n\t\tawait registries.components.register(this, dir);\n\n\t\tconsole.log(this.stores);\n\t}\n\n\tasync deploy() {\n\t\tawait commandDeploy(this);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/client/trivious.client.ts"],"names":[],"mappings":";;;;;;AAeA,MAAO,uBAAqC,MAAA,CAAO;AAAA,EAClD,QAAA;AAAA,EACS,MAAA;AAAA,EAUT,YAAY,OAAA,EAAgC;AAC3C,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,QAAA,GAAW,OAAA;AAEhB,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACb,QAAA,EAAU;AAAA,QACT,SAAA,EAAW,IAAI,UAAA,EAAW;AAAA,QAC1B,OAAA,EAAS,IAAI,UAAA;AAAW,OACzB;AAAA,MACA,UAAA,EAAY,I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AAS,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAC5C,IAAA,MAAM,UAAA,CAAW,UAAA,CAAW,QAAA,CAAS,IAAA,EAAM,GAAG,CAAA;AAAA,EAC/C;AAAA,EAEA,MAAM,MAAA,GAAS;AACd,IAAA,MAAM,cAAc,IAAI,CAAA;AAAA,EACzB;AACD","file":"trivious.client.js","sourcesContent":["import { Client, Collection } from \"discord.js\";\nimport registries from \"src/shared/registries.js\";\nimport structure from \"../structure/index.structure.js\";\n\nimport type {\n\tBaseContextCommandData,\n\tComponent,\n\tEvent,\n\tModule,\n\tSlashCommandData,\n\tTriviousClientOptions,\n} from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport commandDeploy from \"./deploy.client.js\";\n\nexport default class TriviousClient extends Client {\n\ttrivious: TriviousClientOptions;\n\treadonly stores: {\n\t\tcommands: {\n\t\t\tchatInput: Collection<string, SlashCommandData>;\n\t\t\tcontext: Collection<string, BaseContextCommandData>;\n\t\t};\n\t\tcomponents: Collection<string, Component>;\n\t\tevents: Collection<string, Event>;\n\t\tmodules: Collection<string, Module>;\n\t};\n\n\tconstructor(options: TriviousClientOptions) {\n\t\tsuper(options);\n\t\tthis.trivious = options;\n\n\t\tthis.stores = {\n\t\t\tcommands: {\n\t\t\t\tchatInput: new Collection(),\n\t\t\t\tcontext: new Collection(),\n\t\t\t},\n\t\t\tcomponents: new Collection(),\n\t\t\tevents: new Collection(),\n\t\t\tmodules: new Collection(),\n\t\t};\n\t}\n\n\t/**\n\t * Register, deploy and log into the bot.\n\t *\n\t * @throws {TriviousError} If invalid bot token\n\t */\n\tasync start() {\n\t\tconst token = process.env[this.trivious.credentials.tokenReference];\n\t\tif (!token) {\n\t\t\tthrow new TriviousError(\n\t\t\t\t`Bot token environment variable '${this.trivious.credentials.tokenReference}' does not exist!`,\n\t\t\t\t\"Null environment variable\"\n\t\t\t);\n\t\t}\n\n\t\tawait this.register();\n\t\tawait this.deploy();\n\n\t\ttry {\n\t\t\tawait registries.events.bind(this);\n\t\t\tawait registries.modules.bind(this);\n\t\t} catch (err: any) {\n\t\t\tconst error = new TriviousError(err.message, \"Error during events and modules binds\");\n\t\t\tconsole.error(error);\n\t\t}\n\n\t\tawait this.login(token);\n\t}\n\n\tasync register() {\n\t\tconst dir = structure.resolveRelativePath(this.trivious.corePath);\n\n\t\tawait registries.events.register(this, dir);\n\t\tawait registries.modules.register(this, dir);\n\t\tawait registries.commands.register(this, dir);\n\t\tawait registries.components.register(this, dir);\n\t}\n\n\tasync deploy() {\n\t\tawait commandDeploy(this);\n\t}\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { d as BaseChatInputCommandData, B as BaseCommandData, e as BaseContextCommandData, C as ChatInputCommandContext, b as ChatInputCommandFunction, a as CommandFlags, h as ContextCommandData, c as ContextMenuCommandFunction, M as MessageCommandData, S as SlashCommandData, g as SlashSubcommandData, f as SlashSubcommandGroupData, U as UserCommandData } from '../../modules.types-Bn4HfuVk.js';
2
+ export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as CommandFlags, d as CommandFunction, i as ContextCommandData, M as MessageCommandData, S as SlashCommandData, k as SlashSubcommandData, l as SlashSubcommandGroupData, U as UserCommandData } from '../../modules.types-uNvWKT4j.js';
3
3
  import '../client/client.types.js';
@@ -1,6 +1,6 @@
1
1
  import * as discord_js from 'discord.js';
2
- import { Interaction, CacheType, InteractionReplyOptions, InteractionEditReplyOptions, MessagePayload, ChatInputCommandInteraction } from 'discord.js';
3
- import { a as CommandFlags, T as TriviousClient, S as SlashCommandData } from '../../modules.types-Bn4HfuVk.js';
2
+ import { ChatInputCommandInteraction, Interaction, CacheType, InteractionReplyOptions, InteractionEditReplyOptions, MessagePayload } from 'discord.js';
3
+ import { T as TriviousClient, S as SlashCommandData, c as CommandFlags } from '../../modules.types-uNvWKT4j.js';
4
4
  import '../client/client.types.js';
5
5
 
6
6
  declare function interactionReply(options: {
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
 
@@ -11,12 +11,14 @@ function validateCommand(command, expects) {
11
11
  }
12
12
  async function parseSlashSubcommands(directory, data) {
13
13
  const subcommands = new Collection();
14
+ if (!("addSubcommand" in data.data)) return subcommands;
14
15
  const files = promises.glob(join(directory, "./*.js"));
15
16
  for await (const file of files) {
16
17
  const subcommand = await importFile(file);
17
18
  if (!subcommand || !validateCommand(subcommand, (subcmd) => subcmd.context === "SlashSubcommand"))
18
19
  continue;
19
20
  subcommand.parent = data;
21
+ data.data.addSubcommand(subcommand.data);
20
22
  subcommands.set(subcommand.data.name, subcommand);
21
23
  }
22
24
  if (subcommands.size > 0) data.subcommands = subcommands;
@@ -25,7 +27,8 @@ async function parseSlashSubcommands(directory, data) {
25
27
  async function parseSlashCommand(file, parentDir, subdirectories) {
26
28
  if (!existsSync(file)) return;
27
29
  const command = await importFile(file);
28
- if (!command || !validateCommand(command, (cmd) => cmd.context === "SlashCommand")) return;
30
+ if (!command || !validateCommand(command, (cmd) => cmd.context === "SlashCommand") || !("addSubcommand" in command.data))
31
+ return;
29
32
  await parseSlashSubcommands(parentDir, command);
30
33
  for (const subdir of subdirectories) {
31
34
  const indexFile = path.resolve(subdir.parentPath, subdir.name, "index.js");
@@ -35,7 +38,10 @@ async function parseSlashCommand(file, parentDir, subdirectories) {
35
38
  group.parent = command;
36
39
  if (!command.subcommandGroups) command.subcommandGroups = new Collection();
37
40
  await parseSlashSubcommands(join(subdir.parentPath, subdir.name), group);
38
- if (group.subcommands.size > 0) command.subcommandGroups.set(group.data.name, group);
41
+ if (group.subcommands.size > 0) {
42
+ command.data.addSubcommandGroup(group.data);
43
+ command.subcommandGroups.set(group.data.name, group);
44
+ }
39
45
  }
40
46
  return command;
41
47
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["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ED,EAAA,MAAM,oBAAA,uBAA2B,GAAA,EAAY;AAE7C,EAAA,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,SAAS,CAAC,CAAA;AAChD,EAAA,WAAA,MAAiB,QAAQ,KAAA,EAAO;AAC/B,IAAA,MAAM,SAAA,GAAY,IAAA,CAAK,OAAA,CAAQ,IAAI,CAAA;AAEnC,IAAA,IAAI,oBAAA,CAAqB,GAAA,CAAI,SAAS,CAAA,EAAG;AACzC,IAAA,oBAAA,CAAqB,IAAI,SAAS,CAAA;AAElC,IAAA,MAAM,iBAAA,CAAkB,QAAQ,SAAS,CAAA;AAAA,EAC1C;AACD","file":"registry.commands.js","sourcesContent":["import type {\n\tBaseChatInputCommandData,\n\tBaseContextCommandData,\n\tMessageCommandData,\n\tSlashCommandData,\n\tSlashSubcommandData,\n\tSlashSubcommandGroupData,\n\tTriviousClient,\n\tUserCommandData,\n} from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport { importFile } from \"#utility/functions.js\";\nimport { ApplicationCommandType, Collection } from \"discord.js\";\nimport { Dirent, existsSync, promises as fs } from \"fs\";\nimport path, { join } from \"path\";\n\nfunction validateCommand<T extends BaseChatInputCommandData | BaseContextCommandData>(\n\tcommand: T,\n\texpects: (command: Partial<T>) => boolean\n): boolean {\n\tif (!(\"active\" in command && \"commandType\" in command)) return false;\n\tif (!command.active) return false;\n\treturn expects(command);\n}\n\nasync function parseSlashSubcommands(\n\tdirectory: string,\n\tdata: SlashCommandData | SlashSubcommandGroupData<boolean>\n) {\n\tconst _parentType = \"context\" in data ? \"command\" : \"group\";\n\tconst subcommands = new Collection<string, SlashSubcommandData<true, typeof _parentType>>();\n\n\tconst files = fs.glob(join(directory, \"./*.js\"));\n\tfor await (const file of files) {\n\t\tconst subcommand = await importFile<SlashSubcommandData<true, typeof _parentType>>(file);\n\t\tif (\n\t\t\t!subcommand ||\n\t\t\t!validateCommand(subcommand, (subcmd) => subcmd.context === \"SlashSubcommand\")\n\t\t)\n\t\t\tcontinue;\n\n\t\tsubcommand.parent = data;\n\t\tsubcommands.set(subcommand.data.name, subcommand);\n\t}\n\n\tif (subcommands.size > 0) data.subcommands = subcommands;\n\treturn subcommands;\n}\n\nasync function parseSlashCommand(\n\tfile: string,\n\tparentDir: string,\n\tsubdirectories: Dirent<string>[]\n) {\n\tif (!existsSync(file)) return;\n\n\tconst command = await importFile<SlashCommandData>(file);\n\tif (!command || !validateCommand(command, (cmd) => cmd.context === \"SlashCommand\")) return;\n\n\tawait parseSlashSubcommands(parentDir, command);\n\n\tfor (const subdir of subdirectories) {\n\t\tconst indexFile = path.resolve(subdir.parentPath, subdir.name, \"index.js\");\n\t\tif (!existsSync(indexFile)) continue;\n\n\t\tconst group = await importFile<SlashSubcommandGroupData<true>>(indexFile);\n\t\tif (!group || !(\"context\" in group) || group.context !== \"SlashSubcommandGroup\") continue;\n\n\t\tgroup.parent = command;\n\t\tif (!command.subcommandGroups) command.subcommandGroups = new Collection();\n\t\tawait parseSlashSubcommands(join(subdir.parentPath, subdir.name), group);\n\n\t\tif (group.subcommands.size > 0) command.subcommandGroups.set(group.data.name, group);\n\t}\n\n\treturn command;\n}\n\nasync function parseContextCommands(parentDir: string) {\n\tconst collection = new Collection<string, MessageCommandData | UserCommandData>();\n\tconst files = fs.glob(join(parentDir, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst contextCommand = await importFile<MessageCommandData | UserCommandData>(file);\n\t\tif (\n\t\t\t!contextCommand ||\n\t\t\t!validateCommand(\n\t\t\t\tcontextCommand,\n\t\t\t\t(cmd) =>\n\t\t\t\t\tcmd.commandType === ApplicationCommandType.Message ||\n\t\t\t\t\tcmd.commandType === ApplicationCommandType.User\n\t\t\t)\n\t\t)\n\t\t\tcontinue;\n\n\t\tcontextCommand.data.setType(contextCommand.commandType);\n\t\tcollection.set(contextCommand.data.name, contextCommand);\n\t}\n\n\treturn collection;\n}\n\nasync function registerDirectory(client: TriviousClient, parentDir: string) {\n\tconst entries = await fs.readdir(parentDir, { withFileTypes: true });\n\tconst subdirectories = entries.filter((entry) => entry.isDirectory());\n\n\tconst indexFile = path.resolve(parentDir, \"index.js\");\n\tconst slashCommand = await parseSlashCommand(indexFile, parentDir, subdirectories);\n\tif (slashCommand) client.stores.commands.chatInput.set(slashCommand.data.name, slashCommand);\n\n\tconst contextCommands = await parseContextCommands(parentDir);\n\tcontextCommands.forEach((cmd) => client.stores.commands.context.set(cmd.data.name, cmd));\n}\n\nexport default async function registerCommands(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register commands; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst processedDirectories = new Set<string>();\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst parentDir = path.dirname(file);\n\n\t\tif (processedDirectories.has(parentDir)) continue;\n\t\tprocessedDirectories.add(parentDir);\n\n\t\tawait registerDirectory(client, parentDir);\n\t}\n}\n"]}
1
+ {"version":3,"sources":["../../../src/features/commands/registry.commands.ts"],"names":["fs"],"mappings":";;;;;;AAgBA,SAAS,eAAA,CACR,SACA,OAAA,EACU;AACV,EAAA,IAAI,EAAE,QAAA,IAAY,OAAA,IAAW,aAAA,IAAiB,UAAU,OAAO,KAAA;AAC/D,EAAA,IAAI,CAAC,OAAA,CAAQ,MAAA,EAAQ,OAAO,KAAA;AAC5B,EAAA,OAAO,QAAQ,OAAO,CAAA;AACvB;AAEA,eAAe,qBAAA,CACd,WACA,IAAA,EACC;AAED,EAAA,MAAM,WAAA,GAAc,IAAI,UAAA,EAAkE;AAE1F,EAAA,IAAI,EAAE,eAAA,IAAmB,IAAA,CAAK,IAAA,CAAA,EAAO,OAAO,WAAA;AAE5C,EAAA,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,QAAQ,CAAC,CAAA;AAC/C,EA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AAA;AAEnC,IAAA,IAAI,oBAAA,CAAqB,GAAA,CAAI,SAAS,CAAA,EAAG;AACzC,IAAA,oBAAA,CAAqB,IAAI,SAAS,CAAA;AAElC,IAAA,MAAM,iBAAA,CAAkB,QAAQ,SAAS,CAAA;AAAA,EAC1C;AACD","file":"registry.commands.js","sourcesContent":["import type {\n\tBaseChatInputCommandData,\n\tBaseContextCommandData,\n\tMessageCommandData,\n\tSlashCommandData,\n\tSlashSubcommandData,\n\tSlashSubcommandGroupData,\n\tTriviousClient,\n\tUserCommandData,\n} from \"#typings\";\nimport { TriviousError } from \"#utility/errors.js\";\nimport { importFile } from \"#utility/functions.js\";\nimport { ApplicationCommandType, Collection } from \"discord.js\";\nimport { Dirent, existsSync, promises as fs } from \"fs\";\nimport path, { join } from \"path\";\n\nfunction validateCommand<T extends BaseChatInputCommandData | BaseContextCommandData>(\n\tcommand: T,\n\texpects: (command: Partial<T>) => boolean\n): boolean {\n\tif (!(\"active\" in command && \"commandType\" in command)) return false;\n\tif (!command.active) return false;\n\treturn expects(command);\n}\n\nasync function parseSlashSubcommands(\n\tdirectory: string,\n\tdata: SlashCommandData | SlashSubcommandGroupData<boolean>\n) {\n\tconst _parentType = \"context\" in data ? \"command\" : \"group\";\n\tconst subcommands = new Collection<string, SlashSubcommandData<true, typeof _parentType>>();\n\n\tif (!(\"addSubcommand\" in data.data)) return subcommands;\n\n\tconst files = fs.glob(join(directory, \"./*.js\"));\n\tfor await (const file of files) {\n\t\tconst subcommand = await importFile<SlashSubcommandData<true, typeof _parentType>>(file);\n\t\tif (\n\t\t\t!subcommand ||\n\t\t\t!validateCommand(subcommand, (subcmd) => subcmd.context === \"SlashSubcommand\")\n\t\t)\n\t\t\tcontinue;\n\n\t\tsubcommand.parent = data;\n\t\tdata.data.addSubcommand(subcommand.data);\n\t\tsubcommands.set(subcommand.data.name, subcommand);\n\t}\n\n\tif (subcommands.size > 0) data.subcommands = subcommands;\n\treturn subcommands;\n}\n\nasync function parseSlashCommand(\n\tfile: string,\n\tparentDir: string,\n\tsubdirectories: Dirent<string>[]\n) {\n\tif (!existsSync(file)) return;\n\n\tconst command = await importFile<SlashCommandData>(file);\n\tif (\n\t\t!command ||\n\t\t!validateCommand(command, (cmd) => cmd.context === \"SlashCommand\") ||\n\t\t!(\"addSubcommand\" in command.data)\n\t)\n\t\treturn;\n\n\tawait parseSlashSubcommands(parentDir, command);\n\n\tfor (const subdir of subdirectories) {\n\t\tconst indexFile = path.resolve(subdir.parentPath, subdir.name, \"index.js\");\n\t\tif (!existsSync(indexFile)) continue;\n\n\t\tconst group = await importFile<SlashSubcommandGroupData<true>>(indexFile);\n\t\tif (!group || !(\"context\" in group) || group.context !== \"SlashSubcommandGroup\") continue;\n\n\t\tgroup.parent = command;\n\t\tif (!command.subcommandGroups) command.subcommandGroups = new Collection();\n\t\tawait parseSlashSubcommands(join(subdir.parentPath, subdir.name), group);\n\n\t\tif (group.subcommands.size > 0) {\n\t\t\tcommand.data.addSubcommandGroup(group.data);\n\t\t\tcommand.subcommandGroups.set(group.data.name, group);\n\t\t}\n\t}\n\n\treturn command;\n}\n\nasync function parseContextCommands(parentDir: string) {\n\tconst collection = new Collection<string, MessageCommandData | UserCommandData>();\n\tconst files = fs.glob(join(parentDir, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst contextCommand = await importFile<MessageCommandData | UserCommandData>(file);\n\t\tif (\n\t\t\t!contextCommand ||\n\t\t\t!validateCommand(\n\t\t\t\tcontextCommand,\n\t\t\t\t(cmd) =>\n\t\t\t\t\tcmd.commandType === ApplicationCommandType.Message ||\n\t\t\t\t\tcmd.commandType === ApplicationCommandType.User\n\t\t\t)\n\t\t)\n\t\t\tcontinue;\n\n\t\tcontextCommand.data.setType(contextCommand.commandType);\n\t\tcollection.set(contextCommand.data.name, contextCommand);\n\t}\n\n\treturn collection;\n}\n\nasync function registerDirectory(client: TriviousClient, parentDir: string) {\n\tconst entries = await fs.readdir(parentDir, { withFileTypes: true });\n\tconst subdirectories = entries.filter((entry) => entry.isDirectory());\n\n\tconst indexFile = path.resolve(parentDir, \"index.js\");\n\tconst slashCommand = await parseSlashCommand(indexFile, parentDir, subdirectories);\n\tif (slashCommand) client.stores.commands.chatInput.set(slashCommand.data.name, slashCommand);\n\n\tconst contextCommands = await parseContextCommands(parentDir);\n\tcontextCommands.forEach((cmd) => client.stores.commands.context.set(cmd.data.name, cmd));\n}\n\nexport default async function registerCommands(client: TriviousClient, directory: string) {\n\tif (!existsSync(directory))\n\t\tthrow new TriviousError(\n\t\t\t`Could not register commands; passed directory '${directory}' does not exist!`,\n\t\t\t\"Nonexistant directory passed\"\n\t\t);\n\n\tconst processedDirectories = new Set<string>();\n\n\tconst files = fs.glob(join(directory, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst parentDir = path.dirname(file);\n\n\t\tif (processedDirectories.has(parentDir)) continue;\n\t\tprocessedDirectories.add(parentDir);\n\n\t\tawait registerDirectory(client, parentDir);\n\t}\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { l as Component, k as ComponentContext, i as ComponentFlags, j as ComponentInteraction } from '../../modules.types-Bn4HfuVk.js';
2
+ export { e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction } from '../../modules.types-uNvWKT4j.js';
3
3
  import '../client/client.types.js';
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import '../client/client.types.js';
2
- import { k as ComponentContext } from '../../modules.types-Bn4HfuVk.js';
2
+ import { f as ComponentContext } from '../../modules.types-uNvWKT4j.js';
3
3
  import 'discord.js';
4
4
 
5
5
  type ComponentTag = "awaited";
@@ -1,7 +1,7 @@
1
1
  import { ComponentCustomId } from './customid.types.js';
2
2
  import '../client/client.types.js';
3
3
  import 'discord.js';
4
- import '../../modules.types-Bn4HfuVk.js';
4
+ import '../../modules.types-uNvWKT4j.js';
5
5
 
6
6
  /**
7
7
  * Decode a customId into its parts
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { E as Event } from '../../modules.types-Bn4HfuVk.js';
2
+ export { E as Event } from '../../modules.types-uNvWKT4j.js';
3
3
  import '../client/client.types.js';
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../../client/client.types.js';
4
4
 
@@ -1,5 +1,5 @@
1
1
  import * as discord_js from 'discord.js';
2
- import { T as TriviousClient } from '../../../modules.types-Bn4HfuVk.js';
2
+ import { T as TriviousClient } from '../../../modules.types-uNvWKT4j.js';
3
3
  import '../../client/client.types.js';
4
4
 
5
5
  declare const _default: {
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
 
@@ -1,3 +1,3 @@
1
1
  import 'discord.js';
2
- export { m as Module } from '../../modules.types-Bn4HfuVk.js';
2
+ export { j as Module } from '../../modules.types-uNvWKT4j.js';
3
3
  import '../client/client.types.js';
@@ -1,4 +1,4 @@
1
- import { T as TriviousClient } from '../../modules.types-Bn4HfuVk.js';
1
+ import { T as TriviousClient } from '../../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../client/client.types.js';
4
4
 
package/dist/index.d.ts CHANGED
@@ -2,6 +2,6 @@ export { createActionRow, createEmbed } from './features/builders/utility.builde
2
2
  export { handleSlashCommand, interactionReply } from './features/commands/methods.commands.js';
3
3
  export { decodeCustomId, encodeCustomId } from './features/customId/methods.customid.js';
4
4
  export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from './features/client/client.types.js';
5
- export { d as BaseChatInputCommandData, B as BaseCommandData, e as BaseContextCommandData, C as ChatInputCommandContext, b as ChatInputCommandFunction, a as CommandFlags, l as Component, k as ComponentContext, i as ComponentFlags, j as ComponentInteraction, h as ContextCommandData, c as ContextMenuCommandFunction, E as Event, M as MessageCommandData, m as Module, S as SlashCommandData, g as SlashSubcommandData, f as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from './modules.types-Bn4HfuVk.js';
5
+ export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as CommandFlags, d as CommandFunction, e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction, i as ContextCommandData, E as Event, M as MessageCommandData, j as Module, S as SlashCommandData, k as SlashSubcommandData, l as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from './modules.types-uNvWKT4j.js';
6
6
  export { ComponentCustomId, ComponentTag } from './features/customId/customid.types.js';
7
7
  import 'discord.js';
@@ -1,4 +1,4 @@
1
- import { Client, Collection, ApplicationCommandType, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandBuilder, ChatInputCommandInteraction, SlashCommandSubcommandGroupBuilder, ContextMenuCommandInteraction, ContextMenuCommandBuilder, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, AnySelectMenuInteraction, ButtonInteraction, ModalSubmitInteraction, ClientEvents } from 'discord.js';
1
+ import { Client, Collection, ApplicationCommandType, Interaction, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandBuilder, ChatInputCommandInteraction, SlashCommandSubcommandGroupBuilder, ContextMenuCommandBuilder, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, AnySelectMenuInteraction, ButtonInteraction, ModalSubmitInteraction, ClientEvents } from 'discord.js';
2
2
  import { TriviousClientOptions } from './features/client/client.types.js';
3
3
 
4
4
  declare class TriviousClient extends Client {
@@ -25,8 +25,7 @@ declare class TriviousClient extends Client {
25
25
 
26
26
  type ChatInputCommandContext = "SlashCommand" | "SlashSubcommand" | "SlashSubcommandGroup";
27
27
  type CommandFlags = "Cached" | "DeferReply" | "EphemeralReply" | "ExpectModal";
28
- type ChatInputCommandFunction = (client: TriviousClient, interaction: ChatInputCommandInteraction) => Promise<void>;
29
- type ContextMenuCommandFunction<T extends ContextMenuCommandInteraction> = (client: TriviousClient, interaction: T) => Promise<void>;
28
+ type CommandFunction<T extends Interaction> = (client: TriviousClient, interaction: T) => Promise<void>;
30
29
  /**
31
30
  * Base Trivious command data
32
31
  *
@@ -72,7 +71,7 @@ interface SlashCommandData extends BaseChatInputCommandData {
72
71
  data: SlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder;
73
72
  subcommands?: Collection<string, SlashSubcommandData<true, "command">>;
74
73
  subcommandGroups?: Collection<string, SlashSubcommandGroupData<true>>;
75
- run?: ChatInputCommandFunction;
74
+ run?: CommandFunction<ChatInputCommandInteraction>;
76
75
  }
77
76
  /**
78
77
  * Trivious slash subcommand group data
@@ -97,7 +96,7 @@ interface SlashSubcommandGroupData<Processed extends boolean = false> {
97
96
  interface SlashSubcommandData<Processed extends boolean = false, Parent extends "command" | "group" = "command"> extends BaseChatInputCommandData {
98
97
  context: "SlashSubcommand";
99
98
  data: SlashCommandSubcommandBuilder;
100
- execute: ChatInputCommandFunction;
99
+ execute: CommandFunction<ChatInputCommandInteraction>;
101
100
  parent?: Processed extends true ? Parent extends "command" ? SlashCommandData : SlashSubcommandGroupData<true> : Parent extends "command" ? SlashCommandData | undefined : SlashSubcommandGroupData<false> | undefined;
102
101
  }
103
102
  /**
@@ -111,7 +110,7 @@ interface SlashSubcommandData<Processed extends boolean = false, Parent extends
111
110
  interface MessageCommandData extends BaseContextCommandData {
112
111
  commandType: ApplicationCommandType.Message;
113
112
  data: ContextMenuCommandBuilder;
114
- execute: ContextMenuCommandFunction<MessageContextMenuCommandInteraction>;
113
+ execute: CommandFunction<MessageContextMenuCommandInteraction>;
115
114
  }
116
115
  /**
117
116
  * Trivious user command data
@@ -124,7 +123,7 @@ interface MessageCommandData extends BaseContextCommandData {
124
123
  interface UserCommandData extends BaseContextCommandData {
125
124
  commandType: ApplicationCommandType.User;
126
125
  data: ContextMenuCommandBuilder;
127
- execute: ContextMenuCommandFunction<UserContextMenuCommandInteraction>;
126
+ execute: CommandFunction<UserContextMenuCommandInteraction>;
128
127
  }
129
128
  type ContextCommandData = MessageCommandData | UserCommandData;
130
129
 
@@ -162,4 +161,4 @@ interface Module {
162
161
  };
163
162
  }
164
163
 
165
- export { type BaseCommandData as B, type ChatInputCommandContext as C, type Event as E, type MessageCommandData as M, type SlashCommandData as S, TriviousClient as T, type UserCommandData as U, type CommandFlags as a, type ChatInputCommandFunction as b, type ContextMenuCommandFunction as c, type BaseChatInputCommandData as d, type BaseContextCommandData as e, type SlashSubcommandGroupData as f, type SlashSubcommandData as g, type ContextCommandData as h, type ComponentFlags as i, type ComponentInteraction as j, ComponentContext as k, type Component as l, type Module as m };
164
+ export { type BaseChatInputCommandData as B, type ChatInputCommandContext as C, type Event as E, type MessageCommandData as M, type SlashCommandData as S, TriviousClient as T, type UserCommandData as U, type BaseCommandData as a, type BaseContextCommandData as b, type CommandFlags as c, type CommandFunction as d, type Component as e, ComponentContext as f, type ComponentFlags as g, type ComponentInteraction as h, type ContextCommandData as i, type Module as j, type SlashSubcommandData as k, type SlashSubcommandGroupData as l };
@@ -2,7 +2,7 @@ import registerCommands from '../features/commands/registry.commands.js';
2
2
  import registerComponents from '../features/components/registry.components.js';
3
3
  import registerEvents, { bindEvents } from '../features/events/registry.events.js';
4
4
  import registerModules, { bindModules } from '../features/modules/registry.modules.js';
5
- import '../modules.types-Bn4HfuVk.js';
5
+ import '../modules.types-uNvWKT4j.js';
6
6
  import 'discord.js';
7
7
  import '../features/client/client.types.js';
8
8
 
@@ -1,4 +1,4 @@
1
1
  export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from '../features/client/client.types.js';
2
- export { d as BaseChatInputCommandData, B as BaseCommandData, e as BaseContextCommandData, C as ChatInputCommandContext, b as ChatInputCommandFunction, a as CommandFlags, l as Component, k as ComponentContext, i as ComponentFlags, j as ComponentInteraction, h as ContextCommandData, c as ContextMenuCommandFunction, E as Event, M as MessageCommandData, m as Module, S as SlashCommandData, g as SlashSubcommandData, f as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from '../modules.types-Bn4HfuVk.js';
2
+ export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as CommandFlags, d as CommandFunction, e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction, i as ContextCommandData, E as Event, M as MessageCommandData, j as Module, S as SlashCommandData, k as SlashSubcommandData, l as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from '../modules.types-uNvWKT4j.js';
3
3
  export { ComponentCustomId, ComponentTag } from '../features/customId/customid.types.js';
4
4
  import 'discord.js';
@@ -1,4 +1,4 @@
1
- import { B as BaseCommandData, S as SlashCommandData } from '../modules.types-Bn4HfuVk.js';
1
+ import { a as BaseCommandData, S as SlashCommandData } from '../modules.types-uNvWKT4j.js';
2
2
  import 'discord.js';
3
3
  import '../features/client/client.types.js';
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trivious",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "keywords": [
6
6
  "discord-bot",