trivious 2.1.8 → 2.1.10
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 +1 -1
- package/dist/features/commands/builders.commands.d.ts +9 -1
- package/dist/features/commands/builders.commands.js +15 -1
- package/dist/features/commands/builders.commands.js.map +1 -1
- package/dist/features/commands/methods.commands.js +27 -13
- package/dist/features/commands/methods.commands.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,9 +4,17 @@ import '../client/client.types.js';
|
|
|
4
4
|
import '../permissions/permissions.types.js';
|
|
5
5
|
|
|
6
6
|
declare function createSlashCommand(data: Omit<SlashCommandData, "context" | "commandType" | "subcommands" | "subcommandGroups">): SlashCommandData;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use createSlashSubcommand instead
|
|
9
|
+
*/
|
|
7
10
|
declare function createSubcommand(data: Omit<SlashSubcommandData, "context" | "commandType" | "parent">): SlashSubcommandData;
|
|
11
|
+
declare function createSlashSubcommand(data: Omit<SlashSubcommandData, "context" | "commandType" | "parent">): SlashSubcommandData;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use createSlashSubcommandGroup instead
|
|
14
|
+
*/
|
|
8
15
|
declare function createSubcommandGroup(data: Omit<SlashSubcommandGroupData, "context" | "parent" | "subcommands">): SlashSubcommandGroupData;
|
|
16
|
+
declare function createSlashSubcommandGroup(data: Omit<SlashSubcommandGroupData, "context" | "parent" | "subcommands">): SlashSubcommandGroupData;
|
|
9
17
|
declare function createMessageContextCommand(data: Omit<ContextCommandData<"Message">, "commandType">): ContextCommandData<"Message">;
|
|
10
18
|
declare function createUserContextCommand(data: Omit<ContextCommandData<"User">, "commandType">): ContextCommandData<"User">;
|
|
11
19
|
|
|
12
|
-
export { createMessageContextCommand, createSlashCommand, createSubcommand, createSubcommandGroup, createUserContextCommand };
|
|
20
|
+
export { createMessageContextCommand, createSlashCommand, createSlashSubcommand, createSlashSubcommandGroup, createSubcommand, createSubcommandGroup, createUserContextCommand };
|
|
@@ -14,6 +14,13 @@ function createSubcommand(data) {
|
|
|
14
14
|
commandType: ApplicationCommandType.ChatInput
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
+
function createSlashSubcommand(data) {
|
|
18
|
+
return {
|
|
19
|
+
...data,
|
|
20
|
+
context: "SlashSubcommand",
|
|
21
|
+
commandType: ApplicationCommandType.ChatInput
|
|
22
|
+
};
|
|
23
|
+
}
|
|
17
24
|
function createSubcommandGroup(data) {
|
|
18
25
|
return {
|
|
19
26
|
...data,
|
|
@@ -21,6 +28,13 @@ function createSubcommandGroup(data) {
|
|
|
21
28
|
subcommands: new Collection()
|
|
22
29
|
};
|
|
23
30
|
}
|
|
31
|
+
function createSlashSubcommandGroup(data) {
|
|
32
|
+
return {
|
|
33
|
+
...data,
|
|
34
|
+
context: "SlashSubcommandGroup",
|
|
35
|
+
subcommands: new Collection()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
24
38
|
function createMessageContextCommand(data) {
|
|
25
39
|
return {
|
|
26
40
|
...data,
|
|
@@ -34,6 +48,6 @@ function createUserContextCommand(data) {
|
|
|
34
48
|
};
|
|
35
49
|
}
|
|
36
50
|
|
|
37
|
-
export { createMessageContextCommand, createSlashCommand, createSubcommand, createSubcommandGroup, createUserContextCommand };
|
|
51
|
+
export { createMessageContextCommand, createSlashCommand, createSlashSubcommand, createSlashSubcommandGroup, createSubcommand, createSubcommandGroup, createUserContextCommand };
|
|
38
52
|
//# sourceMappingURL=builders.commands.js.map
|
|
39
53
|
//# sourceMappingURL=builders.commands.js.map
|
|
@@ -1 +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;
|
|
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;AAKO,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,EACsB;AACtB,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,OAAA,EAAS,iBAAA;AAAA,IACT,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD;AAKO,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,2BACf,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,4BACf,IAAA,EACgC;AAChC,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD;AAEO,SAAS,yBACf,IAAA,EAC6B;AAC7B,EAAA,OAAO;AAAA,IACN,GAAG,IAAA;AAAA,IACH,aAAa,sBAAA,CAAuB;AAAA,GACrC;AACD","file":"builders.commands.js","sourcesContent":["import {\n\tContextCommandData,\n\tSlashCommandData,\n\tSlashSubcommandData,\n\tSlashSubcommandGroupData,\n} from \"#typings\";\nimport { ApplicationCommandType, Collection } from \"discord.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\n/**\n * @deprecated Use createSlashSubcommand instead\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 createSlashSubcommand(\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\n/**\n * @deprecated Use createSlashSubcommandGroup instead\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 createSlashSubcommandGroup(\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 createMessageContextCommand(\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 createUserContextCommand(\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"]}
|
|
@@ -9,26 +9,32 @@ async function interactionReply(options) {
|
|
|
9
9
|
}
|
|
10
10
|
return await interaction.reply(payload);
|
|
11
11
|
}
|
|
12
|
-
async function
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
16
|
-
if (command.flags?.includes("DeferReply")) {
|
|
12
|
+
async function handleFlags(interaction, flags) {
|
|
13
|
+
if (flags?.includes("Cached") && !interaction.inCachedGuild()) return;
|
|
14
|
+
if (flags?.includes("ExpectModal")) return;
|
|
15
|
+
if (flags?.includes("DeferReply")) {
|
|
17
16
|
await interactionReply({
|
|
18
17
|
interaction,
|
|
19
|
-
flags
|
|
18
|
+
flags,
|
|
20
19
|
replyPayload: { content: "Processing command..." }
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} catch (err) {
|
|
27
|
-
console.error(err);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
22
|
+
}
|
|
23
|
+
async function handleSlashCommand(client, command, interaction) {
|
|
24
|
+
const { options } = interaction;
|
|
30
25
|
const subcommandGroup = options.getSubcommandGroup(false);
|
|
31
26
|
const subcommand = options.getSubcommand(false);
|
|
27
|
+
if (!subcommandGroup || !subcommand) {
|
|
28
|
+
await handleFlags(interaction, command.flags);
|
|
29
|
+
if ("run" in command && command.run) {
|
|
30
|
+
try {
|
|
31
|
+
await command.run(client, interaction);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.error(err);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
32
38
|
if (subcommandGroup && command.subcommandGroups && subcommand) {
|
|
33
39
|
const foundGroup = command.subcommandGroups.get(subcommandGroup);
|
|
34
40
|
if (!foundGroup) {
|
|
@@ -50,6 +56,7 @@ async function handleSlashCommand(client, command, interaction) {
|
|
|
50
56
|
});
|
|
51
57
|
return;
|
|
52
58
|
}
|
|
59
|
+
await handleFlags(interaction, foundSubcommand.flags || command.flags);
|
|
53
60
|
return await foundSubcommand.execute(client, interaction);
|
|
54
61
|
} else if (subcommand && command.subcommands) {
|
|
55
62
|
const foundSubcommand = command.subcommands.get(subcommand);
|
|
@@ -61,7 +68,14 @@ async function handleSlashCommand(client, command, interaction) {
|
|
|
61
68
|
});
|
|
62
69
|
return;
|
|
63
70
|
}
|
|
71
|
+
await handleFlags(interaction, foundSubcommand.flags || command.flags);
|
|
64
72
|
return await foundSubcommand.execute(client, interaction);
|
|
73
|
+
} else {
|
|
74
|
+
await interactionReply({
|
|
75
|
+
interaction,
|
|
76
|
+
flags: ["EphemeralReply"],
|
|
77
|
+
replyPayload: { content: "Command is outdated, inactive, or does not have a handler!" }
|
|
78
|
+
});
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/commands/methods.commands.ts"],"names":[],"mappings":"AA8BA,eAAsB,iBAAiB,OAAA,EAIpC;AACF,EAAA,MAAM,EAAE,WAAA,EAAa,YAAA,EAAc,KAAA,EAAM,GAAI,OAAA;AAC7C,EAAA,IAAI,EAAE,WAAW,WAAA,CAAA,EAAc;AAE/B,EAAA,MAAM,OAAA,GAAU,YAAA;AAChB,EAAA,IAAI,OAAO,QAAA,CAAS,gBAAgB,GAAG,OAAA,CAAQ,KAAA,GAAQ,CAAC,WAAW,CAAA;AAEnE,EAAA,IAAI,WAAA,CAAY,QAAA,IAAY,WAAA,CAAY,OAAA,EAAS;AAChD,IAAA,IAAI,KAAA,EAAO,SAAS,UAAU,CAAA,SAAU,MAAM,WAAA,CAAY,SAAS,OAAO,CAAA;AAC1E,IAAA,OAAO,MAAM,WAAA,CAAY,SAAA,CAAU,OAAsC,CAAA;AAAA,EAC1E;AAEA,EAAA,OAAO,MAAM,WAAA,C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A,IAAS,QAAQ,KAAK,CAAA;AACrE,IAAA,OAAO,MAAM,eAAA,CAAgB,OAAA,CAAQ,MAAA,EAAQ,WAAW,CAAA;AAAA,EACzD,CAAA,MAAA,IAAW,UAAA,IAAc,OAAA,CAAQ,WAAA,EAAa;AAC7C,IAAA,MAAM,eAAA,GAAkB,OAAA,CAAQ,WAAA,CAAY,GAAA,CAAI,UAAU,CAAA;AAC1D,IAAA,IAAI,CAAC,eAAA,EAAiB;AACrB,MAAA,MAAM,gBAAA,CAAiB;AAAA,QACtB,WAAA;AAAA,QACA,KAAA,EAAO,CAAC,gBAAgB,CAAA;AAAA,QACxB,YAAA,EAAc,EAAE,OAAA,EAAS,+DAAA;AAAgE,OACzF,CAAA;AACD,MAAA;AAAA,IACD;AAEA,IAAA,MAAM,WAAA,CAAY,WAAA,EAAa,eAAA,CAAgB,KAAA,IAAS,QAAQ,KAAK,CAAA;AACrE,IAAA,OAAO,MAAM,eAAA,CAAgB,OAAA,CAAQ,MAAA,EAAQ,WAAW,CAAA;AAAA,EACzD,CAAA,MAAO;AACN,IAAA,MAAM,gBAAA,CAAiB;AAAA,MACtB,WAAA;AAAA,MACA,KAAA,EAAO,CAAC,gBAAgB,CAAA;AAAA,MACxB,YAAA,EAAc,EAAE,OAAA,EAAS,4DAAA;AAA6D,KACtF,CAAA;AAAA,EACF;AACD","file":"methods.commands.js","sourcesContent":["import { CommandFlags, SlashCommandData, TriviousClient } from \"#typings\";\nimport {\n\tCacheType,\n\tChatInputCommandInteraction,\n\tInteraction,\n\tInteractionEditReplyOptions,\n\tInteractionReplyOptions,\n\tInteractionResponse,\n\tMessage,\n\tMessagePayload,\n} from \"discord.js\";\n\nexport async function interactionReply(options: {\n\tinteraction: Interaction<CacheType>;\n\treplyPayload: InteractionReplyOptions;\n\tflags?: (CommandFlags | \"FollowUp\")[];\n}): Promise<InteractionResponse<boolean>>;\n\nexport async function interactionReply(options: {\n\tinteraction: Interaction<CacheType>;\n\treplyPayload: InteractionEditReplyOptions;\n\tflags?: (CommandFlags | \"FollowUp\")[];\n}): Promise<Message<boolean>>;\n\nexport async function interactionReply(options: {\n\tinteraction: Interaction<CacheType>;\n\treplyPayload: MessagePayload;\n\tflags?: (CommandFlags | \"FollowUp\")[];\n}): Promise<InteractionResponse<boolean> | Message<boolean>>;\n\nexport async function interactionReply(options: {\n\tinteraction: Interaction<CacheType>;\n\treplyPayload: InteractionReplyOptions | InteractionEditReplyOptions | MessagePayload;\n\tflags?: (CommandFlags | \"FollowUp\")[];\n}) {\n\tconst { interaction, replyPayload, flags } = options;\n\tif (!(\"reply\" in interaction)) return;\n\n\tconst payload = replyPayload as InteractionReplyOptions;\n\tif (flags?.includes(\"EphemeralReply\")) payload.flags = [\"Ephemeral\"];\n\n\tif (interaction.deferred || interaction.replied) {\n\t\tif (flags?.includes(\"FollowUp\")) return await interaction.followUp(payload);\n\t\treturn await interaction.editReply(payload as InteractionEditReplyOptions);\n\t}\n\n\treturn await interaction.reply(payload);\n}\n\nasync function handleFlags(interaction: ChatInputCommandInteraction, flags?: CommandFlags[]) {\n\tif (flags?.includes(\"Cached\") && !interaction.inCachedGuild()) return;\n\tif (flags?.includes(\"ExpectModal\")) return;\n\tif (flags?.includes(\"DeferReply\")) {\n\t\tawait interactionReply({\n\t\t\tinteraction,\n\t\t\tflags: flags,\n\t\t\treplyPayload: { content: \"Processing command...\" },\n\t\t});\n\t}\n}\n\nexport async function handleSlashCommand(\n\tclient: TriviousClient,\n\tcommand: SlashCommandData,\n\tinteraction: ChatInputCommandInteraction\n) {\n\tconst { options } = interaction;\n\n\tconst subcommandGroup = options.getSubcommandGroup(false);\n\tconst subcommand = options.getSubcommand(false);\n\n\tif (!subcommandGroup || !subcommand) {\n\t\tawait handleFlags(interaction, command.flags);\n\n\t\tif (\"run\" in command && command.run) {\n\t\t\ttry {\n\t\t\t\tawait command.run(client, interaction);\n\t\t\t} catch (err: any) {\n\t\t\t\tconsole.error(err);\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif (subcommandGroup && command.subcommandGroups && subcommand) {\n\t\tconst foundGroup = command.subcommandGroups.get(subcommandGroup);\n\t\tif (!foundGroup) {\n\t\t\tawait interactionReply({\n\t\t\t\tinteraction,\n\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\treplyPayload: {\n\t\t\t\t\tcontent: \"Subcommand group is outdated, inactive, or does not have a handler!\",\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tconst foundSubcommand = foundGroup.subcommands.get(subcommand);\n\t\tif (!foundSubcommand) {\n\t\t\tawait interactionReply({\n\t\t\t\tinteraction,\n\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\treplyPayload: { content: \"Subcommand is outdated, inactive, or does not have a handler!\" },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tawait handleFlags(interaction, foundSubcommand.flags || command.flags);\n\t\treturn await foundSubcommand.execute(client, interaction);\n\t} else if (subcommand && command.subcommands) {\n\t\tconst foundSubcommand = command.subcommands.get(subcommand);\n\t\tif (!foundSubcommand) {\n\t\t\tawait interactionReply({\n\t\t\t\tinteraction,\n\t\t\t\tflags: [\"EphemeralReply\"],\n\t\t\t\treplyPayload: { content: \"Subcommand is outdated, inactive, or does not have a handler!\" },\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tawait handleFlags(interaction, foundSubcommand.flags || command.flags);\n\t\treturn await foundSubcommand.execute(client, interaction);\n\t} else {\n\t\tawait interactionReply({\n\t\t\tinteraction,\n\t\t\tflags: [\"EphemeralReply\"],\n\t\t\treplyPayload: { content: \"Command is outdated, inactive, or does not have a handler!\" },\n\t\t});\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createActionRow, createEmbed } from './features/builders/utility.builders.js';
|
|
2
|
-
export { createMessageContextCommand, createSlashCommand, createSubcommand, createSubcommandGroup, createUserContextCommand } from './features/commands/builders.commands.js';
|
|
2
|
+
export { createMessageContextCommand, createSlashCommand, createSlashSubcommand, createSlashSubcommandGroup, createSubcommand, createSubcommandGroup, createUserContextCommand } from './features/commands/builders.commands.js';
|
|
3
3
|
export { handleSlashCommand, interactionReply } from './features/commands/methods.commands.js';
|
|
4
4
|
export { default as customId } from './features/customId/methods.customid.js';
|
|
5
5
|
export { CommandHashConfiguration, FeatureBasedStructure, TriviousClientCredentials, TriviousClientOptions, TriviousStructure, TypeBasedStructure } from './features/client/client.types.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trivious",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord-bot",
|
|
@@ -75,6 +75,6 @@
|
|
|
75
75
|
"vitest": "^4.0.13"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"discord.js": "^14.
|
|
78
|
+
"discord.js": "^14.26.3"
|
|
79
79
|
}
|
|
80
80
|
}
|