trivious 2.0.0 → 2.0.1
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 +4 -2
- package/dist/features/client/client.types.d.ts +1 -1
- package/dist/features/client/deploy.client.d.ts +1 -1
- package/dist/features/client/deploy.client.js +2 -2
- package/dist/features/client/deploy.client.js.map +1 -1
- package/dist/features/client/trivious.client.d.ts +1 -1
- package/dist/features/client/trivious.client.js +2 -3
- package/dist/features/client/trivious.client.js.map +1 -1
- package/dist/features/commands/commands.types.d.ts +1 -1
- package/dist/features/commands/methods.commands.d.ts +2 -2
- package/dist/features/commands/registry.commands.d.ts +1 -1
- package/dist/features/commands/registry.commands.js +8 -2
- package/dist/features/commands/registry.commands.js.map +1 -1
- package/dist/features/components/components.types.d.ts +1 -1
- package/dist/features/components/registry.components.d.ts +1 -1
- package/dist/features/customId/customid.types.d.ts +1 -1
- package/dist/features/customId/methods.customid.d.ts +1 -1
- package/dist/features/events/events.types.d.ts +1 -1
- package/dist/features/events/presets/clientReady.d.ts +1 -1
- package/dist/features/events/presets/interactionCreate.d.ts +1 -1
- package/dist/features/events/registry.events.d.ts +1 -1
- package/dist/features/modules/modules.types.d.ts +1 -1
- package/dist/features/modules/registry.modules.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{modules.types-Bn4HfuVk.d.ts → modules.types-4hfuUiCb.d.ts} +2 -2
- package/dist/shared/registries.d.ts +1 -1
- package/dist/shared/typings.d.ts +1 -1
- package/dist/utility/errors.d.ts +1 -1
- 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) {
|
|
@@ -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.
|
|
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":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,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 {
|
|
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,EAA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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"]}
|
|
@@ -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.
|
|
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.
|
|
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"],"names":[],"mappings":";;;;;;AAeA,MAAO,uBAAqC,MAAA,CAAO;AAAA,EAClD,QAAA;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S,WAAA,CAAY,cAAc,CAAA,iBAAA,CAAA;AAAA,QAC3E;AAAA,OACD;AAAA,IACD;AAEA,IAAA,MAAM,KAAK,QAAA,EAAS;AACpB,IAAA,MAAM,KAAK,MAAA,EAAO;AAElB,IAAA,IAAI;AACH,MAAA,MAAM,UAAA,CAAW,MAAA,CAAO,IAAA,CAAK,IAAI,CAAA;AACjC,MAAA,MAAM,UAAA,CAAW,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAA;AAAA,IACnC,SAAS,GAAA,EAAU;AAClB,MAAA,MAAM,KAAA,GAAQ,IAAI,aAAA,CAAc,GAAA,CAAI,SAAS,uCAAuC,CAAA;AACpF,MAAA,OAAA,CAAQ,MAAM,KAAK,CAAA;AAAA,IACpB;AAEA,IAAA,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;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 {
|
|
2
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as ChatInputCommandFunction, d as CommandFlags, i as ContextCommandData, j as ContextMenuCommandFunction, M as MessageCommandData, S as SlashCommandData, l as SlashSubcommandData, m as SlashSubcommandGroupData, U as UserCommandData } from '../../modules.types-4hfuUiCb.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
|
|
3
|
-
import {
|
|
2
|
+
import { ChatInputCommandInteraction, Interaction, CacheType, InteractionReplyOptions, InteractionEditReplyOptions, MessagePayload } from 'discord.js';
|
|
3
|
+
import { T as TriviousClient, S as SlashCommandData, d as CommandFlags } from '../../modules.types-4hfuUiCb.js';
|
|
4
4
|
import '../client/client.types.js';
|
|
5
5
|
|
|
6
6
|
declare function interactionReply(options: {
|
|
@@ -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"))
|
|
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)
|
|
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":["../../../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,MAAM,QAAQA,QAAA,CAAG,IAAA,CAAK,IAAA,CAAK,SAAA,EAAW,QAAQ,CAAC,CAAA;AAC/C,EAAA,WAAA,MAAiB,QAAQ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BAAA,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 {
|
|
2
|
+
export { e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction } from '../../modules.types-4hfuUiCb.js';
|
|
3
3
|
import '../client/client.types.js';
|
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 {
|
|
5
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as ChatInputCommandFunction, d as CommandFlags, e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction, i as ContextCommandData, j as ContextMenuCommandFunction, E as Event, M as MessageCommandData, k as Module, S as SlashCommandData, l as SlashSubcommandData, m as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from './modules.types-4hfuUiCb.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,
|
|
1
|
+
import { Client, Collection, ApplicationCommandType, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandsOnlyBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, ChatInputCommandInteraction, ContextMenuCommandBuilder, ContextMenuCommandInteraction, 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 {
|
|
@@ -162,4 +162,4 @@ interface Module {
|
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
export { type
|
|
165
|
+
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 ChatInputCommandFunction as c, type CommandFlags as d, type Component as e, ComponentContext as f, type ComponentFlags as g, type ComponentInteraction as h, type ContextCommandData as i, type ContextMenuCommandFunction as j, type Module as k, type SlashSubcommandData as l, type SlashSubcommandGroupData as m };
|
|
@@ -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-
|
|
5
|
+
import '../modules.types-4hfuUiCb.js';
|
|
6
6
|
import 'discord.js';
|
|
7
7
|
import '../features/client/client.types.js';
|
|
8
8
|
|
package/dist/shared/typings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from '../features/client/client.types.js';
|
|
2
|
-
export {
|
|
2
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, b as BaseContextCommandData, C as ChatInputCommandContext, c as ChatInputCommandFunction, d as CommandFlags, e as Component, f as ComponentContext, g as ComponentFlags, h as ComponentInteraction, i as ContextCommandData, j as ContextMenuCommandFunction, E as Event, M as MessageCommandData, k as Module, S as SlashCommandData, l as SlashSubcommandData, m as SlashSubcommandGroupData, T as TriviousClient, U as UserCommandData } from '../modules.types-4hfuUiCb.js';
|
|
3
3
|
export { ComponentCustomId, ComponentTag } from '../features/customId/customid.types.js';
|
|
4
4
|
import 'discord.js';
|
package/dist/utility/errors.d.ts
CHANGED