trivious 2.1.1 → 2.1.3
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/features/client/deploy.client.d.ts +1 -1
- package/dist/features/client/deploy.client.js +1 -3
- 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.map +1 -1
- package/dist/features/commands/builders.commands.d.ts +12 -0
- package/dist/features/commands/builders.commands.js +39 -0
- package/dist/features/commands/builders.commands.js.map +1 -0
- package/dist/features/commands/commands.types.d.ts +1 -1
- package/dist/features/commands/methods.commands.d.ts +1 -1
- package/dist/features/commands/registry.commands.d.ts +1 -1
- package/dist/features/commands/registry.commands.js +15 -1
- 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/presets/interactionCreate.js.map +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/features/permissions/methods.permissions.d.ts +1 -1
- package/dist/features/permissions/methods.permissions.js +1 -0
- package/dist/features/permissions/methods.permissions.js.map +1 -1
- package/dist/features/permissions/permissions.types.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{modules.types-BUvtZD_e.d.ts → modules.types-BY9Ncpz7.d.ts} +6 -31
- 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
|
@@ -13,9 +13,7 @@ async function commandDeploy(client) {
|
|
|
13
13
|
const commands = client.stores.commands;
|
|
14
14
|
const body = [
|
|
15
15
|
...commands.chatInput.map((command) => command.data.toJSON()),
|
|
16
|
-
...commands.context.map(
|
|
17
|
-
(command) => command.data.toJSON()
|
|
18
|
-
)
|
|
16
|
+
...commands.context.map((command) => command.data.toJSON())
|
|
19
17
|
];
|
|
20
18
|
if (commandHashConfig && commandHashConfig.enabled) {
|
|
21
19
|
const hashFile = join(commandHashConfig.persistentDataPath || "data", "commands.hash");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/client/deploy.client.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/features/client/deploy.client.ts"],"names":[],"mappings":";;;;;;AAOA,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,CAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,IAAA,CAAK,MAAA,EAAQ;AAAA,GAC3D;AAEA,EAAA,IAAI,iBAAA,IAAqB,kBAAkB,OAAA,EAAS;AACnD,IAAA,MAAM,QAAA,GAAW,IAAA,CAAK,iBAAA,CAAkB,kBA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["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 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) => command.data.toJSON()),\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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/client/trivious.client.ts"],"names":[],"mappings":";;;;;;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AAK,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 {\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,IAAI,UAAA,EAAW;AAAA,MAC3B,MAAA,EAAQ,IAAI,UAAA,EAAW;AAAA,MACvB,OAAA,EAAS,IAAI,UAAA;AAAW,KACzB;AAAA,EACD;AAAA;AAAA;AAAA;A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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 {\n\tComponent,\n\tContextCommandData,\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, ContextCommandData>;\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"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { h as ContextCommandData, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData } from '../../modules.types-BY9Ncpz7.js';
|
|
2
|
+
import 'discord.js';
|
|
3
|
+
import '../client/client.types.js';
|
|
4
|
+
import '../permissions/permissions.types.js';
|
|
5
|
+
|
|
6
|
+
declare function createSlashCommand(data: Omit<SlashCommandData, "context" | "commandType" | "subcommands" | "subcommandGroups">): SlashCommandData;
|
|
7
|
+
declare function createSubcommand(data: Omit<SlashSubcommandData, "context" | "commandType" | "parent">): SlashSubcommandData;
|
|
8
|
+
declare function createSubcommandGroup(data: Omit<SlashSubcommandGroupData, "context" | "parent" | "subcommands">): SlashSubcommandGroupData;
|
|
9
|
+
declare function createMessageComponentCommand(data: Omit<ContextCommandData<"Message">, "commandType">): ContextCommandData<"Message">;
|
|
10
|
+
declare function createUserComponentCommand(data: Omit<ContextCommandData<"User">, "commandType">): ContextCommandData<"User">;
|
|
11
|
+
|
|
12
|
+
export { createMessageComponentCommand, createSlashCommand, createSubcommand, createSubcommandGroup, createUserComponentCommand };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ApplicationCommandType, Collection } from 'discord.js';
|
|
2
|
+
|
|
3
|
+
function createSlashCommand(data) {
|
|
4
|
+
return {
|
|
5
|
+
...data,
|
|
6
|
+
context: "SlashCommand",
|
|
7
|
+
commandType: ApplicationCommandType.ChatInput
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function createSubcommand(data) {
|
|
11
|
+
return {
|
|
12
|
+
...data,
|
|
13
|
+
context: "SlashSubcommand",
|
|
14
|
+
commandType: ApplicationCommandType.ChatInput
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function createSubcommandGroup(data) {
|
|
18
|
+
return {
|
|
19
|
+
...data,
|
|
20
|
+
context: "SlashSubcommandGroup",
|
|
21
|
+
subcommands: new Collection()
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function createMessageComponentCommand(data) {
|
|
25
|
+
return {
|
|
26
|
+
...data,
|
|
27
|
+
commandType: ApplicationCommandType.Message
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function createUserComponentCommand(data) {
|
|
31
|
+
return {
|
|
32
|
+
...data,
|
|
33
|
+
commandType: ApplicationCommandType.User
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { createMessageComponentCommand, createSlashCommand, createSubcommand, createSubcommandGroup, createUserComponentCommand };
|
|
38
|
+
//# sourceMappingURL=builders.commands.js.map
|
|
39
|
+
//# sourceMappingURL=builders.commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/features/commands/builders.commands.ts"],"names":[],"mappings":";;AAQO,SAAS,mBACf,IAAA,EACmB;AACnB,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,OAAA,EAAS,cAAA;AAAA,IACT,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD;AAEO,SAAS,iBACf,IAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,OAAA,EAAS,iBAAA;AAAA,IACT,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD;AAEO,SAAS,sBACf,IAAA,EAC2B;AAC3B,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,OAAA,EAAS,sBAAA;AAAA,IACT,WAAA,EAAa,IAAI,UAAA;AAAW,GAC7B;AACD;AAEO,SAAS,8BACf,IAAA,EACgC;AAChC,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD;AAEO,SAAS,2BACf,IAAA,EAC6B;AAC7B,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD","file":"builders.commands.js","sourcesContent":["import { ApplicationCommandType, Collection } from \"discord.js\";\nimport {\n\tContextCommandData,\n\tSlashCommandData,\n\tSlashSubcommandData,\n\tSlashSubcommandGroupData,\n} from \"./commands.types.js\";\n\nexport function createSlashCommand(\n\tdata: Omit<SlashCommandData, \"context\" | \"commandType\" | \"subcommands\" | \"subcommandGroups\">\n): SlashCommandData {\n\treturn {\n\t\t...data,\n\t\tcontext: \"SlashCommand\",\n\t\tcommandType: ApplicationCommandType.ChatInput,\n\t} satisfies SlashCommandData;\n}\n\nexport function createSubcommand(\n\tdata: Omit<SlashSubcommandData, \"context\" | \"commandType\" | \"parent\">\n): SlashSubcommandData {\n\treturn {\n\t\t...data,\n\t\tcontext: \"SlashSubcommand\",\n\t\tcommandType: ApplicationCommandType.ChatInput,\n\t} satisfies SlashSubcommandData;\n}\n\nexport function createSubcommandGroup(\n\tdata: Omit<SlashSubcommandGroupData, \"context\" | \"parent\" | \"subcommands\">\n): SlashSubcommandGroupData {\n\treturn {\n\t\t...data,\n\t\tcontext: \"SlashSubcommandGroup\",\n\t\tsubcommands: new Collection(),\n\t} satisfies SlashSubcommandGroupData;\n}\n\nexport function createMessageComponentCommand(\n\tdata: Omit<ContextCommandData<\"Message\">, \"commandType\">\n): ContextCommandData<\"Message\"> {\n\treturn {\n\t\t...data,\n\t\tcommandType: ApplicationCommandType.Message,\n\t} satisfies ContextCommandData<\"Message\">;\n}\n\nexport function createUserComponentCommand(\n\tdata: Omit<ContextCommandData<\"User\">, \"commandType\">\n): ContextCommandData<\"User\"> {\n\treturn {\n\t\t...data,\n\t\tcommandType: ApplicationCommandType.User,\n\t} satisfies ContextCommandData<\"User\">;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { B as BaseChatInputCommandData, a as BaseCommandData,
|
|
2
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CommandFlags, c as CommandFunction, h as ContextCommandData, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData } from '../../modules.types-BY9Ncpz7.js';
|
|
3
3
|
import '../permissions/permissions.types.js';
|
|
4
4
|
import '../client/client.types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
2
|
import { ChatInputCommandInteraction, Interaction, CacheType, InteractionReplyOptions, InteractionEditReplyOptions, MessagePayload } from 'discord.js';
|
|
3
|
-
import { T as TriviousClient, S as SlashCommandData,
|
|
3
|
+
import { T as TriviousClient, S as SlashCommandData, b as CommandFlags } from '../../modules.types-BY9Ncpz7.js';
|
|
4
4
|
import '../client/client.types.js';
|
|
5
5
|
import '../permissions/permissions.types.js';
|
|
6
6
|
|
|
@@ -19,6 +19,10 @@ async function parseSlashSubcommands(directory, data) {
|
|
|
19
19
|
continue;
|
|
20
20
|
subcommand.parent = data;
|
|
21
21
|
data.data.addSubcommand(subcommand.data);
|
|
22
|
+
if (subcommands.has(subcommand.data.name))
|
|
23
|
+
console.warn(
|
|
24
|
+
`[Trivious] Subcommand '${subcommand.data.name}' under ${data.context} '${data.data.name}' has a duplicate and has been overridden`
|
|
25
|
+
);
|
|
22
26
|
subcommands.set(subcommand.data.name, subcommand);
|
|
23
27
|
}
|
|
24
28
|
if (subcommands.size > 0) data.subcommands = subcommands;
|
|
@@ -40,6 +44,10 @@ async function parseSlashCommand(file, parentDir, subdirectories) {
|
|
|
40
44
|
if (!command.subcommandGroups) command.subcommandGroups = new Collection();
|
|
41
45
|
await parseSlashSubcommands(join(subdir.parentPath, subdir.name), group);
|
|
42
46
|
if (group.subcommands.size > 0) {
|
|
47
|
+
if (command.subcommandGroups.has(group.data.name))
|
|
48
|
+
console.warn(
|
|
49
|
+
`[Trivious] SubcommandGroup '${group.data.name}' under SlashCommand '${command.data.name}' has a duplicate and has been overridden`
|
|
50
|
+
);
|
|
43
51
|
command.data.addSubcommandGroup(group.data);
|
|
44
52
|
command.subcommandGroups.set(group.data.name, group);
|
|
45
53
|
}
|
|
@@ -66,7 +74,13 @@ async function registerDirectory(client, parentDir) {
|
|
|
66
74
|
const subdirectories = entries.filter((entry) => entry.isDirectory());
|
|
67
75
|
const indexFile = path.resolve(parentDir, "index.js");
|
|
68
76
|
const slashCommand = await parseSlashCommand(indexFile, parentDir, subdirectories);
|
|
69
|
-
if (slashCommand)
|
|
77
|
+
if (slashCommand) {
|
|
78
|
+
if (client.stores.commands.chatInput.has(slashCommand.data.name))
|
|
79
|
+
console.warn(
|
|
80
|
+
`[Trivious] SlashCommand '${slashCommand.data.name}' has a duplicate and has been overridden`
|
|
81
|
+
);
|
|
82
|
+
client.stores.commands.chatInput.set(slashCommand.data.name, slashCommand);
|
|
83
|
+
}
|
|
70
84
|
const contextCommands = await parseContextCommands(parentDir);
|
|
71
85
|
contextCommands.forEach((cmd) => client.stores.commands.context.set(cmd.data.name, cmd));
|
|
72
86
|
}
|
|
@@ -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,IAAI,EAAE,eAAA,IAAmB,IAAA,CAAK,IAAA,CAAA,EAAO,OAAO,WAAA;AAE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,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 {\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<typeof _parentType, true>>();\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<typeof _parentType, true>>(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 (\n\t\t\t!group ||\n\t\t\t!(\"context\" in group && \"addSubcommandGroup\" in command.data) ||\n\t\t\tgroup.context !== \"SlashSubcommandGroup\"\n\t\t)\n\t\t\tcontinue;\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
|
+
{"version":3,"sources":["../../../src/features/commands/registry.commands.ts"],"names":["fs"],"mappings":";;;;;;AAcA,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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SubcommandGroupData,\n\tTriviousClient,\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 | ContextCommandData>(\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<typeof _parentType, true>>();\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<typeof _parentType, true>>(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\n\t\tif (subcommands.has(subcommand.data.name))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] Subcommand '${subcommand.data.name}' under ${data.context} '${data.data.name}' has a duplicate and has been overridden`\n\t\t\t);\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 (\n\t\t\t!group ||\n\t\t\t!(\"context\" in group && \"addSubcommandGroup\" in command.data) ||\n\t\t\tgroup.context !== \"SlashSubcommandGroup\"\n\t\t)\n\t\t\tcontinue;\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\tif (command.subcommandGroups.has(group.data.name))\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`[Trivious] SubcommandGroup '${group.data.name}' under SlashCommand '${command.data.name}' has a duplicate and has been overridden`\n\t\t\t\t);\n\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, ContextCommandData>();\n\tconst files = fs.glob(join(parentDir, \"**/*.js\"));\n\tfor await (const file of files) {\n\t\tconst contextCommand = await importFile<ContextCommandData>(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) {\n\t\tif (client.stores.commands.chatInput.has(slashCommand.data.name))\n\t\t\tconsole.warn(\n\t\t\t\t`[Trivious] SlashCommand '${slashCommand.data.name}' has a duplicate and has been overridden`\n\t\t\t);\n\n\t\tclient.stores.commands.chatInput.set(slashCommand.data.name, slashCommand);\n\t}\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,4 +1,4 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export {
|
|
2
|
+
export { d as Component, e as ComponentContext, f as ComponentFlags, g as ComponentInteraction } from '../../modules.types-BY9Ncpz7.js';
|
|
3
3
|
import '../permissions/permissions.types.js';
|
|
4
4
|
import '../client/client.types.js';
|
|
@@ -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-
|
|
4
|
+
import '../../modules.types-BY9Ncpz7.js';
|
|
5
5
|
import '../permissions/permissions.types.js';
|
|
6
6
|
|
|
7
7
|
declare const customId: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as discord_js from 'discord.js';
|
|
2
|
-
import { T as TriviousClient } from '../../../modules.types-
|
|
2
|
+
import { T as TriviousClient } from '../../../modules.types-BY9Ncpz7.js';
|
|
3
3
|
import '../../client/client.types.js';
|
|
4
4
|
import '../../permissions/permissions.types.js';
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/features/events/presets/interactionCreate.ts"],"names":["subcommand"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/features/events/presets/interactionCreate.ts"],"names":["subcommand"],"mappings":";;;;;;AAuBA,SAAS,sCAAA,CACR,MAAA,EACA,OAAA,EACA,WAAA,EAIU;AACV,EAAA,IAAI,EAAE,aAAA,IAAiB,OAAA,CAAA,EAAU,OAAO,KAAA;AACxC,EAAA,IAAI,CAAC,WAAA,CAAY,kBAAA,EAAmB,EAAG,OAAO,KAAA;AAE9C,EAAA,MAAM,EAAE,SAAQ,GAAI,WAAA;AAEpB,EAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,aAAA,CAAc,KAAK,CAAA;AAClD,EAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,kBAAA,CAAmB,KAAK,CAAA;AAClD,EAAA,IAAI,CAAC,gBAAgB,OAAO,KAAA;AAE5B,EAAA,IAAI,SAAA,EAAW;AACd,IAAA,MAAM,KAAA,GAAQ,OAAA,CAAQ,gBAAA,EAAkB,GAAA,CAAI,SAAS,CAAA;AACrD,IAAA,IAAI,CAAC,OAAO,OAAO,KAAA;AAEnB,IAAA,MAAMA,WAAAA,GAAa,KAAA,CAAM,WAAA,CAAY,GAAA,CAAI,cAAc,CAAA;AACvD,IAAA,IAAI,CAACA,aAAY,OAAO,KAAA;AAExB,IAAA,OAAO,oBAAoB,MAAA,EAAQA,WAAAA,EAAY,WAAA,CAAY,MAAqB,EAAE,CAAC,CAAA;AAAA,EACpF;AAEA,EAAA,MAAM,UAAA,GAAa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OAAA,EAAS,kDAAA,EAAmD;AAAA,UAC5E,KAAA,EAAO,CAAC,gBAAgB;AAAA,SACxB,CAAA;AACD,QAAA;AAAA,MACD;AAEA,MAAA,MAAM,SAAA,CAAU,OAAA,CAAQ,MAAA,EAAQ,WAAW,CAAA;AAAA,IAC5C;AAAA,EACD;AACD","file":"interactionCreate.js","sourcesContent":["import {\n\tComponentContext,\n\tSlashCommandData,\n\tTriviousClient,\n\ttype ContextCommandData,\n\ttype Event,\n} from \"#typings\";\nimport {\n\tApplicationCommandType,\n\tButtonInteraction,\n\tChatInputCommandInteraction,\n\tGuildMember,\n\tMessageContextMenuCommandInteraction,\n\tModalSubmitInteraction,\n\tUserContextMenuCommandInteraction,\n} from \"discord.js\";\nimport { handleSlashCommand, interactionReply } from \"src/features/commands/methods.commands.js\";\nimport customId from \"src/features/customId/methods.customid.js\";\nimport { canMemberRunCommand } from \"src/features/permissions/methods.permissions.js\";\n\n/**\n * Check if the command is a subcommand and validate whether the member can run the command based on subcommand permissions\n */\nfunction validateMemberPermissionsForSubcommand(\n\tclient: TriviousClient,\n\tcommand: SlashCommandData | ContextCommandData,\n\tinteraction:\n\t\t| ChatInputCommandInteraction\n\t\t| MessageContextMenuCommandInteraction\n\t\t| UserContextMenuCommandInteraction\n): boolean {\n\tif (!(\"subcommands\" in command)) return false;\n\tif (!interaction.isChatInputCommand()) return false;\n\n\tconst { options } = interaction;\n\n\tconst subcommandName = options.getSubcommand(false);\n\tconst groupName = options.getSubcommandGroup(false);\n\tif (!subcommandName) return false;\n\n\tif (groupName) {\n\t\tconst group = command.subcommandGroups?.get(groupName);\n\t\tif (!group) return false;\n\n\t\tconst subcommand = group.subcommands.get(subcommandName);\n\t\tif (!subcommand) return false;\n\n\t\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember)[0];\n\t}\n\n\tconst subcommand = command.subcommands?.get(subcommandName);\n\tif (!subcommand) return false;\n\n\treturn canMemberRunCommand(client, subcommand, interaction.member as GuildMember)[0];\n}\n\nexport default {\n\tname: \"interactionCreate\",\n\tasync execute(client, interaction) {\n\t\tif (interaction.isChatInputCommand() || interaction.isContextMenuCommand()) {\n\t\t\tconst { commandName } = interaction;\n\n\t\t\tconst storeToCheck = interaction.isChatInputCommand()\n\t\t\t\t? client.stores.commands.chatInput\n\t\t\t\t: client.stores.commands.context;\n\t\t\tconst command = storeToCheck.get(commandName);\n\n\t\t\tif (!command) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hasPermission =\n\t\t\t\tvalidateMemberPermissionsForSubcommand(client, command, interaction) ||\n\t\t\t\tcanMemberRunCommand(client, command, interaction.member as GuildMember);\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"You do not have permission to run this command\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tcommand.commandType === ApplicationCommandType.ChatInput &&\n\t\t\t\tinteraction.isChatInputCommand()\n\t\t\t) {\n\t\t\t\tawait handleSlashCommand(client, command, interaction);\n\t\t\t} else {\n\t\t\t\tawait (command as ContextCommandData).execute(client, interaction as never);\n\t\t\t}\n\t\t} else if (interaction.isMessageComponent() || interaction.isModalSubmit()) {\n\t\t\tconst { context, identifier, tags } = customId.decode(interaction.customId);\n\n\t\t\tif (context === ComponentContext.Button && !(interaction instanceof ButtonInteraction))\n\t\t\t\treturn;\n\t\t\tif (context === ComponentContext.Modal && !(interaction instanceof ModalSubmitInteraction))\n\t\t\t\treturn;\n\t\t\tif (tags && tags.includes(\"awaited\")) return;\n\n\t\t\tconst component = client.stores.components.get(identifier);\n\n\t\t\tif (!component) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst hasPermission = canMemberRunCommand(\n\t\t\t\tclient,\n\t\t\t\tcomponent,\n\t\t\t\tinteraction.member as GuildMember\n\t\t\t);\n\t\t\tif (!hasPermission) {\n\t\t\t\tawait interactionReply({\n\t\t\t\t\tinteraction,\n\t\t\t\t\treplyPayload: { content: \"You do not have permission to use this component\" },\n\t\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tawait component.execute(client, interaction);\n\t\t}\n\t},\n} satisfies Event<\"interactionCreate\">;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GuildMember, User } from 'discord.js';
|
|
2
|
-
import { T as TriviousClient, a as BaseCommandData,
|
|
2
|
+
import { T as TriviousClient, a as BaseCommandData, d as Component } from '../../modules.types-BY9Ncpz7.js';
|
|
3
3
|
import '../client/client.types.js';
|
|
4
4
|
import './permissions.types.js';
|
|
5
5
|
|
|
@@ -33,6 +33,7 @@ function canUserRunCommand(client, command, user) {
|
|
|
33
33
|
const { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;
|
|
34
34
|
if (!userIds && (requiredMemberPermissions || requiredRoleIds))
|
|
35
35
|
return [false, "Cannot validate permissions; use canMemberRunCommand instead"];
|
|
36
|
+
if (!userIds) return [true, "No permissions set"];
|
|
36
37
|
return userIds.includes(user.id) ? [true, "User can run command"] : [false, "User cannot run command"];
|
|
37
38
|
}
|
|
38
39
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/permissions/methods.permissions.ts"],"names":[],"mappings":"AAGO,SAAS,mBAAA,CACf,MAAA,EACA,OAAA,EACA,MAAA,EACoB;AACpB,EAAA,MAAM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C,MAAM,oBAAoB,CAAA;AAEpD,EAAA,IAAI,MAAA,CAAO,SAAS,YAAA,IAAgB,MAAA,CAAO,SAAS,YAAA,CAAa,QAAA,CAAS,KAAK,EAAE,CAAA;AAChF,IAAA,OAAO,CAAC,MAAM,sBAAsB,CAAA;AAErC,EAAA,MAAM,EAAE,yBAAA,EAA2B,eAAA,EAAiB,OAAA,EAAQ,GAAI,WAAA;AAEhE,EAAA,IAAI,CAAC,YAAY,yBAAA,IAA6B,eAAA,CAAA;AAC7C,IAAA,OAAO,CAAC,OAAO,8DAA8D,CAAA;AAE9E,EAAA,OAAO,OAAA,CAAQ,QAAA,CAAS,IAAA,CAAK,EAAE,CAAA,GAC5B,CAAC,IAAA,EAAM,sBAAsB,CAAA,GAC7B,CAAC,KAAA,EAAO,yBAAyB,CAAA;AACrC","file":"methods.permissions.js","sourcesContent":["import { BaseCommandData, Component, TriviousClient } from \"#typings\";\nimport { GuildMember, User } from \"discord.js\";\n\nexport function canMemberRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tmember: GuildMember\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(member.user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\tif (userIds) return canUserRunCommand(client, command, member.user);\n\n\tlet memberHasPermission = false;\n\tlet memberHasRole = false;\n\n\tif (requiredMemberPermissions) {\n\t\tfor (const bit of requiredMemberPermissions) {\n\t\t\tif (member.permissions.has(bit)) {\n\t\t\t\tmemberHasPermission = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (requiredRoleIds) {\n\t\tfor (const roleId of requiredRoleIds) {\n\t\t\tif (member.roles.cache.has(roleId)) {\n\t\t\t\tmemberHasRole = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn memberHasPermission || memberHasRole\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n\nexport function canUserRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tuser: User\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\n\tif (!userIds && (requiredMemberPermissions || requiredRoleIds))\n\t\treturn [false, \"Cannot validate permissions; use canMemberRunCommand instead\"];\n\n\treturn userIds.includes(user.id)\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/features/permissions/methods.permissions.ts"],"names":[],"mappings":"AAGO,SAAS,mBAAA,CACf,MAAA,EACA,OAAA,EACA,MAAA,EACoB;AACpB,EAAA,MAAM,EAAE,aAAY,GAAI,OAAA;AACxB,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,CAAC,MAAM,oBAAoB,CAAA;AAEpD,EAAA,IAAI,MAAA,CAAO,SAAS,YAAA,IAAgB,MAAA,CAAO,SAAS,YAAA,CAAa,QAAA,CAAS,MAAA,CAAO,IAAA,CAAK,EAAE,CAAA;AACvF,IAAA,OAAO,CAAC,MAAM,sBAAsB,CAAA;AAErC,EAAA,MAAM,EAAE,yBAAA,EAA2B,eAAA,EAAiB,OAAA,EAAQ,GAAI,WAAA;AAChE,EAAA,IAAI,SAAS,OAAO,iBAAA,CAAkB,MAAA,EAAQ,OAAA,EAAS,OAAO,IAAI,CAAA;AAElE,EAAA,IAAI,mBAAA,GAAsB,KAAA;AAC1B,EAAA,IAAI,aAAA,GAAgB,KAAA;AAEpB,EAAA,IAAI,yBAAA,EAA2B;AAC9B,IAAA,KAAA,MAAW,OAAO,yBAAA,EAA2B;AAC5C,MAAA,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ent":["import { BaseCommandData, Component, TriviousClient } from \"#typings\";\nimport { GuildMember, User } from \"discord.js\";\n\nexport function canMemberRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tmember: GuildMember\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(member.user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\tif (userIds) return canUserRunCommand(client, command, member.user);\n\n\tlet memberHasPermission = false;\n\tlet memberHasRole = false;\n\n\tif (requiredMemberPermissions) {\n\t\tfor (const bit of requiredMemberPermissions) {\n\t\t\tif (member.permissions.has(bit)) {\n\t\t\t\tmemberHasPermission = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (requiredRoleIds) {\n\t\tfor (const roleId of requiredRoleIds) {\n\t\t\tif (member.roles.cache.has(roleId)) {\n\t\t\t\tmemberHasRole = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn memberHasPermission || memberHasRole\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n\nexport function canUserRunCommand(\n\tclient: TriviousClient,\n\tcommand: BaseCommandData | Component,\n\tuser: User\n): [boolean, string] {\n\tconst { permissions } = command;\n\tif (!permissions) return [true, \"No permissions set\"];\n\n\tif (client.trivious.ownerUserIds && client.trivious.ownerUserIds.includes(user.id))\n\t\treturn [true, \"User can run command\"];\n\n\tconst { requiredMemberPermissions, requiredRoleIds, userIds } = permissions;\n\n\tif (!userIds && (requiredMemberPermissions || requiredRoleIds))\n\t\treturn [false, \"Cannot validate permissions; use canMemberRunCommand instead\"];\n\n\tif (!userIds) return [true, \"No permissions set\"];\n\treturn userIds.includes(user.id)\n\t\t? [true, \"User can run command\"]\n\t\t: [false, \"User cannot run command\"];\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { createActionRow, createEmbed } from './features/builders/utility.builders.js';
|
|
2
2
|
export { handleSlashCommand, interactionReply } from './features/commands/methods.commands.js';
|
|
3
3
|
export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from './features/client/client.types.js';
|
|
4
|
-
export { B as BaseChatInputCommandData, a as BaseCommandData,
|
|
4
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CommandFlags, c as CommandFunction, d as Component, e as ComponentContext, f as ComponentFlags, g as ComponentInteraction, h as ContextCommandData, E as Event, M as Module, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData, T as TriviousClient } from './modules.types-BY9Ncpz7.js';
|
|
5
5
|
export { ComponentCustomId, ComponentTag } from './features/customId/customid.types.js';
|
|
6
6
|
export { CommandPermissionValues } from './features/permissions/permissions.types.js';
|
|
7
7
|
import 'discord.js';
|
|
@@ -7,7 +7,7 @@ declare class TriviousClient extends Client {
|
|
|
7
7
|
readonly stores: {
|
|
8
8
|
commands: {
|
|
9
9
|
chatInput: Collection<string, SlashCommandData>;
|
|
10
|
-
context: Collection<string,
|
|
10
|
+
context: Collection<string, ContextCommandData>;
|
|
11
11
|
};
|
|
12
12
|
components: Collection<string, Component>;
|
|
13
13
|
events: Collection<string, Event>;
|
|
@@ -55,8 +55,10 @@ interface BaseChatInputCommandData extends BaseCommandData {
|
|
|
55
55
|
*
|
|
56
56
|
* @param commandType ApplicationCommandType.Message | ApplicationCommandType.User
|
|
57
57
|
*/
|
|
58
|
-
interface
|
|
59
|
-
commandType: ApplicationCommandType.Message | ApplicationCommandType.User;
|
|
58
|
+
interface ContextCommandData<T extends "Message" | "User" | null = null> extends BaseCommandData {
|
|
59
|
+
commandType: T extends null ? ApplicationCommandType.Message | ApplicationCommandType.User : T extends "Message" ? ApplicationCommandType.Message : ApplicationCommandType.User;
|
|
60
|
+
data: ContextMenuCommandBuilder;
|
|
61
|
+
execute: CommandFunction<T extends null ? MessageContextMenuCommandInteraction | UserContextMenuCommandInteraction : T extends "Message" ? MessageContextMenuCommandInteraction : UserContextMenuCommandInteraction>;
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
64
|
* Trivious slash command data
|
|
@@ -101,33 +103,6 @@ interface SlashSubcommandData<Parent extends "command" | "group" = "command", Pr
|
|
|
101
103
|
execute: CommandFunction<ChatInputCommandInteraction>;
|
|
102
104
|
parent?: Processed extends true ? Parent extends "command" ? SlashCommandData : SlashSubcommandGroupData<true> : Parent extends "command" ? SlashCommandData | undefined : SlashSubcommandGroupData<false> | undefined;
|
|
103
105
|
}
|
|
104
|
-
/**
|
|
105
|
-
* Trivious message command data
|
|
106
|
-
*
|
|
107
|
-
* @param context MessageContextCommand
|
|
108
|
-
* @param commandType ApplicationCommandType.Message
|
|
109
|
-
* @param data The context menu builder
|
|
110
|
-
* @param execute Function for when the message command is executed
|
|
111
|
-
*/
|
|
112
|
-
interface MessageCommandData extends BaseContextCommandData {
|
|
113
|
-
commandType: ApplicationCommandType.Message;
|
|
114
|
-
data: ContextMenuCommandBuilder;
|
|
115
|
-
execute: CommandFunction<MessageContextMenuCommandInteraction>;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Trivious user command data
|
|
119
|
-
*
|
|
120
|
-
* @param context UserContextCommand
|
|
121
|
-
* @param commandType ApplicationCommandType.User
|
|
122
|
-
* @param data The context menu builder
|
|
123
|
-
* @param execute Function for when the user command is executed
|
|
124
|
-
*/
|
|
125
|
-
interface UserCommandData extends BaseContextCommandData {
|
|
126
|
-
commandType: ApplicationCommandType.User;
|
|
127
|
-
data: ContextMenuCommandBuilder;
|
|
128
|
-
execute: CommandFunction<UserContextMenuCommandInteraction>;
|
|
129
|
-
}
|
|
130
|
-
type ContextCommandData = MessageCommandData | UserCommandData;
|
|
131
106
|
|
|
132
107
|
type ComponentFlags = "Cached" | "DeferReply" | "EphemeralReply" | "ExpectModal";
|
|
133
108
|
type ComponentInteraction = AnySelectMenuInteraction | ButtonInteraction | ModalSubmitInteraction;
|
|
@@ -164,4 +139,4 @@ interface Module {
|
|
|
164
139
|
};
|
|
165
140
|
}
|
|
166
141
|
|
|
167
|
-
export { type BaseChatInputCommandData as B, type ChatInputCommandContext as C, type Event as E, type
|
|
142
|
+
export { type BaseChatInputCommandData as B, type ChatInputCommandContext as C, type Event as E, type Module as M, type SlashCommandData as S, TriviousClient as T, type BaseCommandData as a, type CommandFlags as b, type CommandFunction as c, type Component as d, ComponentContext as e, type ComponentFlags as f, type ComponentInteraction as g, type ContextCommandData as h, type SlashSubcommandData as i, type SlashSubcommandGroupData as j };
|
|
@@ -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-BY9Ncpz7.js';
|
|
6
6
|
import 'discord.js';
|
|
7
7
|
import '../features/client/client.types.js';
|
|
8
8
|
import '../features/permissions/permissions.types.js';
|
package/dist/shared/typings.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from '../features/client/client.types.js';
|
|
2
|
-
export { B as BaseChatInputCommandData, a as BaseCommandData,
|
|
2
|
+
export { B as BaseChatInputCommandData, a as BaseCommandData, C as ChatInputCommandContext, b as CommandFlags, c as CommandFunction, d as Component, e as ComponentContext, f as ComponentFlags, g as ComponentInteraction, h as ContextCommandData, E as Event, M as Module, S as SlashCommandData, i as SlashSubcommandData, j as SlashSubcommandGroupData, T as TriviousClient } from '../modules.types-BY9Ncpz7.js';
|
|
3
3
|
export { ComponentCustomId, ComponentTag } from '../features/customId/customid.types.js';
|
|
4
4
|
export { CommandPermissionValues } from '../features/permissions/permissions.types.js';
|
|
5
5
|
import 'discord.js';
|
package/dist/utility/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as BaseCommandData, S as SlashCommandData } from '../modules.types-
|
|
1
|
+
import { a as BaseCommandData, S as SlashCommandData } from '../modules.types-BY9Ncpz7.js';
|
|
2
2
|
import 'discord.js';
|
|
3
3
|
import '../features/client/client.types.js';
|
|
4
4
|
import '../features/permissions/permissions.types.js';
|