trivious 1.5.0 → 1.5.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/dist/core/client/trivious.client.d.cts +1 -1
- package/dist/core/client/trivious.client.d.ts +1 -1
- package/dist/core/commands/command.base.d.cts +1 -1
- package/dist/core/commands/command.base.d.ts +1 -1
- package/dist/core/commands/subcommand.base.cjs +8 -1
- package/dist/core/commands/subcommand.base.cjs.map +1 -1
- package/dist/core/commands/subcommand.base.d.cts +1 -1
- package/dist/core/commands/subcommand.base.d.ts +1 -1
- package/dist/core/commands/subcommand.base.js +8 -1
- package/dist/core/commands/subcommand.base.js.map +1 -1
- package/dist/core/components/component.base.d.cts +1 -1
- package/dist/core/components/component.base.d.ts +1 -1
- package/dist/core/events/clientReady.d.cts +1 -1
- package/dist/core/events/clientReady.d.ts +1 -1
- package/dist/core/events/interactionCreate.d.cts +1 -1
- package/dist/core/events/interactionCreate.d.ts +1 -1
- package/dist/core/registry/command.registry.d.cts +1 -1
- package/dist/core/registry/command.registry.d.ts +1 -1
- package/dist/core/registry/component.registry.d.cts +1 -1
- package/dist/core/registry/component.registry.d.ts +1 -1
- package/dist/core/registry/event.registry.d.cts +1 -1
- package/dist/core/registry/event.registry.d.ts +1 -1
- package/dist/core/registry/index.d.cts +1 -1
- package/dist/core/registry/index.d.ts +1 -1
- package/dist/core/registry/module.registry.d.cts +1 -1
- package/dist/core/registry/module.registry.d.ts +1 -1
- package/dist/{index-LB0d9s2b.d.ts → index-Bf8pz7za.d.ts} +3 -2
- package/dist/{index-B7hbKkOJ.d.cts → index-DQ3Y6DvJ.d.cts} +3 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/shared/typings/client.d.cts +1 -1
- package/dist/shared/typings/client.d.ts +1 -1
- package/dist/shared/typings/commands.d.cts +1 -1
- package/dist/shared/typings/commands.d.ts +1 -1
- package/dist/shared/typings/components.d.cts +1 -1
- package/dist/shared/typings/components.d.ts +1 -1
- package/dist/shared/typings/events.d.cts +1 -1
- package/dist/shared/typings/events.d.ts +1 -1
- package/dist/shared/typings/index.d.cts +1 -1
- package/dist/shared/typings/index.d.ts +1 -1
- package/dist/shared/typings/module.d.cts +1 -1
- package/dist/shared/typings/module.d.ts +1 -1
- package/dist/shared/typings/permissions.d.cts +1 -1
- package/dist/shared/typings/permissions.d.ts +1 -1
- package/dist/shared/utility/functions.d.cts +1 -1
- package/dist/shared/utility/functions.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { j as CommandBuilder, l as ContextMenuBuilder, k as ContextMenuCommand, S as SlashCommand, i as default } from '../../index-
|
|
2
|
+
export { j as CommandBuilder, l as ContextMenuBuilder, k as ContextMenuCommand, S as SlashCommand, i as default } from '../../index-DQ3Y6DvJ.cjs';
|
|
3
3
|
import '../../shared/typings/registry.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { j as CommandBuilder, l as ContextMenuBuilder, k as ContextMenuCommand, S as SlashCommand, i as default } from '../../index-
|
|
2
|
+
export { j as CommandBuilder, l as ContextMenuBuilder, k as ContextMenuCommand, S as SlashCommand, i as default } from '../../index-Bf8pz7za.js';
|
|
3
3
|
import '../../shared/typings/registry.js';
|
|
@@ -71,6 +71,13 @@ class SubcommandBuilder extends discord_js.SlashCommandSubcommandBuilder {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
class Subcommand {
|
|
74
|
+
data;
|
|
75
|
+
metadata;
|
|
76
|
+
constructor(builder) {
|
|
77
|
+
const { data, metadata } = builder.build();
|
|
78
|
+
this.data = data;
|
|
79
|
+
this.metadata = metadata;
|
|
80
|
+
}
|
|
74
81
|
/**
|
|
75
82
|
* Reply to the interaction respecting command metadata and if the interaction has already been replied to.
|
|
76
83
|
*
|
|
@@ -80,7 +87,7 @@ class Subcommand {
|
|
|
80
87
|
* @returns {*}
|
|
81
88
|
*/
|
|
82
89
|
async reply(interaction, options) {
|
|
83
|
-
if (interaction.replied) {
|
|
90
|
+
if (interaction.replied || interaction.deferred) {
|
|
84
91
|
await interaction.editReply(options);
|
|
85
92
|
return;
|
|
86
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/commands/subcommand.base.ts"],"names":["SlashCommandSubcommandBuilder","PermissionLevel"],"mappings":";;;;;;;AAmBO,MAAM,0BAA0BA,wCAAA,CAA8B;AAAA,EAC5D,OAAA,GAAU,IAAA;AAAA,EACV,UAAA,GAAa,KAAA;AAAA,EACb,cAAcC,wBAAA,CAAgB,IAAA;AAAA,EAC9B,eAAA,GAAkB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,OAAA,GAAgB;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,KAAA;AACf,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,cAAcA,wBAAA,CAAgB,SAAA;AACnC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,cAAc,UAAA,EAAmC;AACvD,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AACnB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,iBAAA,GAA0B;AAChC,IAAA,IAAA,CAAK,eAAA,GAAkB,IAAA;AACvB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,KAAA,GAAQ;AACd,IAAA,OAAO;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,QAAA,EAAU;AAAA,QACT,QAAQ,IAAA,CAAK,OAAA;AAAA,QACb,WAAW,IAAA,CAAK,UAAA;AAAA,QAChB,YAAY,IAAA,CAAK,WAAA;AAAA,QACjB,gBAAgB,IAAA,CAAK;AAAA;AACtB,KACD;AAAA,EACD;AACD;AAUA,MAAO,UAAA,CAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/core/commands/subcommand.base.ts"],"names":["SlashCommandSubcommandBuilder","PermissionLevel"],"mappings":";;;;;;;AAmBO,MAAM,0BAA0BA,wCAAA,CAA8B;AAAA,EAC5D,OAAA,GAAU,IAAA;AAAA,EACV,UAAA,GAAa,KAAA;AAAA,EACb,cAAcC,wBAAA,CAAgB,IAAA;AAAA,EAC9B,eAAA,GAAkB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,OAAA,GAAgB;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,KAAA;AACf,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,cAAcA,wBAAA,CAAgB,SAAA;AACnC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,cAAc,UAAA,EAAmC;AACvD,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AACnB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,iBAAA,GAA0B;AAChC,IAAA,IAAA,CAAK,eAAA,GAAkB,IAAA;AACvB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,KAAA,GAAQ;AACd,IAAA,OAAO;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,QAAA,EAAU;AAAA,QACT,QAAQ,IAAA,CAAK,OAAA;AAAA,QACb,WAAW,IAAA,CAAK,UAAA;AAAA,QAChB,YAAY,IAAA,CAAK,WAAA;AAAA,QACjB,gBAAgB,IAAA,CAAK;AAAA;AACtB,KACD;AAAA,EACD;AACD;AAUA,MAAO,UAAA,CAAkC;AAAA,EACxB,IAAA;AAAA,EACA,QAAA;AAAA,EAEN,YAAY,OAAA,EAA4B;AACjD,IAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,QAAQ,KAAA,EAAM;AACzC,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBA,MAAM,KAAA,CACL,WAAA,EACA,OAAA,EACC;AACD,IAAA,IAAI,WAAA,CAAY,OAAA,IAAW,WAAA,CAAY,QAAA,EAAU;AAChD,MAAA,MAAM,WAAA,CAAY,UAAU,OAAsC,CAAA;AAClE,MAAA;AAAA,IACD;AAEA,IAAA,MAAM,UAAA,GAAa,EAAE,GAAG,OAAA,EAAQ;AAChC,IAAA,IAAI,KAAK,QAAA,CAAS,cAAA,EAAgB,UAAA,CAAW,KAAA,GAAQ,CAAC,WAAW,CAAA;AAEjE,IAAA,MAAM,WAAA,CAAY,MAAM,UAAU,CAAA;AAAA,EACnC;AACD","file":"subcommand.base.cjs","sourcesContent":["import {\n\tCacheType,\n\tChatInputCommandInteraction,\n\tInteractionEditReplyOptions,\n\tInteractionReplyOptions,\n\tMessagePayload,\n\tSlashCommandSubcommandBuilder,\n} from \"discord.js\";\nimport { PermissionLevel, SubcommandMetadata } from \"src/shared/typings/index.js\";\nimport { TriviousClient } from \"src/index.js\";\n\n/**\n * Base SubcommandBuilder.\n *\n * @export\n * @class SubcommandBuilder\n * @typedef {SubcommandBuilder}\n * @extends {SlashCommandSubcommandBuilder}\n */\nexport class SubcommandBuilder extends SlashCommandSubcommandBuilder {\n\tprivate _active = true;\n\tprivate _ownerOnly = false;\n\tprivate _permission = PermissionLevel.USER;\n\tprivate _ephemeralReply = false;\n\n\t/**\n\t * Set the subcommand as disabled.\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic disable(): this {\n\t\tthis._active = false;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the subcommand as owner only.\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic setOwnerOnly(): this {\n\t\tthis._permission = PermissionLevel.BOT_OWNER;\n\t\tthis._ownerOnly = true;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the permission level required to run the subcommand.\n\t *\n\t * @public\n\t * @param {PermissionLevel} permission\n\t * @returns {this}\n\t */\n\tpublic setPermission(permission: PermissionLevel): this {\n\t\tthis._permission = permission;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the interaction as ephemeral\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic setEphemeralReply(): this {\n\t\tthis._ephemeralReply = true;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the builder.\n\t *\n\t * @public\n\t * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}\n\t */\n\tpublic build() {\n\t\treturn {\n\t\t\tdata: this as SlashCommandSubcommandBuilder,\n\t\t\tmetadata: {\n\t\t\t\tactive: this._active,\n\t\t\t\townerOnly: this._ownerOnly,\n\t\t\t\tpermission: this._permission,\n\t\t\t\tephemeralReply: this._ephemeralReply,\n\t\t\t} satisfies SubcommandMetadata,\n\t\t};\n\t}\n}\n\n/**\n * Base Subcommand\n *\n * @export\n * @abstract\n * @class Subcommand\n * @typedef {Subcommand}\n */\nexport default abstract class Subcommand {\n\tpublic readonly data: SlashCommandSubcommandBuilder;\n\tpublic readonly metadata: SubcommandMetadata;\n\n\tprotected constructor(builder: SubcommandBuilder) {\n\t\tconst { data, metadata } = builder.build();\n\t\tthis.data = data;\n\t\tthis.metadata = metadata;\n\t}\n\n\t/**\n\t * Function to execute the subcommand.\n\t *\n\t * @abstract\n\t * @readonly\n\t * @type {(\n\t * \t\tclient: TriviousClient,\n\t * \t\tinteraction: ChatInputCommandInteraction<CacheType>\n\t * \t) => Promise<void>}\n\t */\n\tabstract readonly execute: (\n\t\tclient: TriviousClient,\n\t\tinteraction: ChatInputCommandInteraction<CacheType>\n\t) => Promise<void>;\n\n\t/**\n\t * Reply to the interaction respecting command metadata and if the interaction has already been replied to.\n\t *\n\t * @async\n\t * @param {ChatInputCommandInteraction<CacheType>} interaction\n\t * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options\n\t * @returns {*}\n\t */\n\tasync reply(\n\t\tinteraction: ChatInputCommandInteraction<CacheType>,\n\t\toptions: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions\n\t) {\n\t\tif (interaction.replied || interaction.deferred) {\n\t\t\tawait interaction.editReply(options as InteractionEditReplyOptions);\n\t\t\treturn;\n\t\t}\n\n\t\tconst newOptions = { ...options } as InteractionReplyOptions;\n\t\tif (this.metadata.ephemeralReply) newOptions.flags = [\"Ephemeral\"];\n\n\t\tawait interaction.reply(newOptions);\n\t}\n}\n"]}
|
|
@@ -67,6 +67,13 @@ class SubcommandBuilder extends SlashCommandSubcommandBuilder {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
class Subcommand {
|
|
70
|
+
data;
|
|
71
|
+
metadata;
|
|
72
|
+
constructor(builder) {
|
|
73
|
+
const { data, metadata } = builder.build();
|
|
74
|
+
this.data = data;
|
|
75
|
+
this.metadata = metadata;
|
|
76
|
+
}
|
|
70
77
|
/**
|
|
71
78
|
* Reply to the interaction respecting command metadata and if the interaction has already been replied to.
|
|
72
79
|
*
|
|
@@ -76,7 +83,7 @@ class Subcommand {
|
|
|
76
83
|
* @returns {*}
|
|
77
84
|
*/
|
|
78
85
|
async reply(interaction, options) {
|
|
79
|
-
if (interaction.replied) {
|
|
86
|
+
if (interaction.replied || interaction.deferred) {
|
|
80
87
|
await interaction.editReply(options);
|
|
81
88
|
return;
|
|
82
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/core/commands/subcommand.base.ts"],"names":[],"mappings":";;;AAmBO,MAAM,0BAA0B,6BAAA,CAA8B;AAAA,EAC5D,OAAA,GAAU,IAAA;AAAA,EACV,UAAA,GAAa,KAAA;AAAA,EACb,cAAc,eAAA,CAAgB,IAAA;AAAA,EAC9B,eAAA,GAAkB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,OAAA,GAAgB;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,KAAA;AACf,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,cAAc,eAAA,CAAgB,SAAA;AACnC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,cAAc,UAAA,EAAmC;AACvD,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AACnB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,iBAAA,GAA0B;AAChC,IAAA,IAAA,CAAK,eAAA,GAAkB,IAAA;AACvB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,KAAA,GAAQ;AACd,IAAA,OAAO;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,QAAA,EAAU;AAAA,QACT,QAAQ,IAAA,CAAK,OAAA;AAAA,QACb,WAAW,IAAA,CAAK,UAAA;AAAA,QAChB,YAAY,IAAA,CAAK,WAAA;AAAA,QACjB,gBAAgB,IAAA,CAAK;AAAA;AACtB,KACD;AAAA,EACD;AACD;AAUA,MAAO,UAAA,CAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/core/commands/subcommand.base.ts"],"names":[],"mappings":";;;AAmBO,MAAM,0BAA0B,6BAAA,CAA8B;AAAA,EAC5D,OAAA,GAAU,IAAA;AAAA,EACV,UAAA,GAAa,KAAA;AAAA,EACb,cAAc,eAAA,CAAgB,IAAA;AAAA,EAC9B,eAAA,GAAkB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,OAAA,GAAgB;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,KAAA;AACf,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,YAAA,GAAqB;AAC3B,IAAA,IAAA,CAAK,cAAc,eAAA,CAAgB,SAAA;AACnC,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASO,cAAc,UAAA,EAAmC;AACvD,IAAA,IAAA,CAAK,WAAA,GAAc,UAAA;AACnB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,iBAAA,GAA0B;AAChC,IAAA,IAAA,CAAK,eAAA,GAAkB,IAAA;AACvB,IAAA,OAAO,IAAA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,KAAA,GAAQ;AACd,IAAA,OAAO;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,QAAA,EAAU;AAAA,QACT,QAAQ,IAAA,CAAK,OAAA;AAAA,QACb,WAAW,IAAA,CAAK,UAAA;AAAA,QAChB,YAAY,IAAA,CAAK,WAAA;AAAA,QACjB,gBAAgB,IAAA,CAAK;AAAA;AACtB,KACD;AAAA,EACD;AACD;AAUA,MAAO,UAAA,CAAkC;AAAA,EACxB,IAAA;AAAA,EACA,QAAA;AAAA,EAEN,YAAY,OAAA,EAA4B;AACjD,IAAA,MAAM,EAAE,IAAA,EAAM,QAAA,EAAS,GAAI,QAAQ,KAAA,EAAM;AACzC,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBA,MAAM,KAAA,CACL,WAAA,EACA,OAAA,EACC;AACD,IAAA,IAAI,WAAA,CAAY,OAAA,IAAW,WAAA,CAAY,QAAA,EAAU;AAChD,MAAA,MAAM,WAAA,CAAY,UAAU,OAAsC,CAAA;AAClE,MAAA;AAAA,IACD;AAEA,IAAA,MAAM,UAAA,GAAa,EAAE,GAAG,OAAA,EAAQ;AAChC,IAAA,IAAI,KAAK,QAAA,CAAS,cAAA,EAAgB,UAAA,CAAW,KAAA,GAAQ,CAAC,WAAW,CAAA;AAEjE,IAAA,MAAM,WAAA,CAAY,MAAM,UAAU,CAAA;AAAA,EACnC;AACD","file":"subcommand.base.js","sourcesContent":["import {\n\tCacheType,\n\tChatInputCommandInteraction,\n\tInteractionEditReplyOptions,\n\tInteractionReplyOptions,\n\tMessagePayload,\n\tSlashCommandSubcommandBuilder,\n} from \"discord.js\";\nimport { PermissionLevel, SubcommandMetadata } from \"src/shared/typings/index.js\";\nimport { TriviousClient } from \"src/index.js\";\n\n/**\n * Base SubcommandBuilder.\n *\n * @export\n * @class SubcommandBuilder\n * @typedef {SubcommandBuilder}\n * @extends {SlashCommandSubcommandBuilder}\n */\nexport class SubcommandBuilder extends SlashCommandSubcommandBuilder {\n\tprivate _active = true;\n\tprivate _ownerOnly = false;\n\tprivate _permission = PermissionLevel.USER;\n\tprivate _ephemeralReply = false;\n\n\t/**\n\t * Set the subcommand as disabled.\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic disable(): this {\n\t\tthis._active = false;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the subcommand as owner only.\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic setOwnerOnly(): this {\n\t\tthis._permission = PermissionLevel.BOT_OWNER;\n\t\tthis._ownerOnly = true;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the permission level required to run the subcommand.\n\t *\n\t * @public\n\t * @param {PermissionLevel} permission\n\t * @returns {this}\n\t */\n\tpublic setPermission(permission: PermissionLevel): this {\n\t\tthis._permission = permission;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the interaction as ephemeral\n\t *\n\t * @public\n\t * @returns {this}\n\t */\n\tpublic setEphemeralReply(): this {\n\t\tthis._ephemeralReply = true;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the builder.\n\t *\n\t * @public\n\t * @returns {{ data: SlashCommandSubcommandBuilder; metadata: SubcommandMetadata; }}\n\t */\n\tpublic build() {\n\t\treturn {\n\t\t\tdata: this as SlashCommandSubcommandBuilder,\n\t\t\tmetadata: {\n\t\t\t\tactive: this._active,\n\t\t\t\townerOnly: this._ownerOnly,\n\t\t\t\tpermission: this._permission,\n\t\t\t\tephemeralReply: this._ephemeralReply,\n\t\t\t} satisfies SubcommandMetadata,\n\t\t};\n\t}\n}\n\n/**\n * Base Subcommand\n *\n * @export\n * @abstract\n * @class Subcommand\n * @typedef {Subcommand}\n */\nexport default abstract class Subcommand {\n\tpublic readonly data: SlashCommandSubcommandBuilder;\n\tpublic readonly metadata: SubcommandMetadata;\n\n\tprotected constructor(builder: SubcommandBuilder) {\n\t\tconst { data, metadata } = builder.build();\n\t\tthis.data = data;\n\t\tthis.metadata = metadata;\n\t}\n\n\t/**\n\t * Function to execute the subcommand.\n\t *\n\t * @abstract\n\t * @readonly\n\t * @type {(\n\t * \t\tclient: TriviousClient,\n\t * \t\tinteraction: ChatInputCommandInteraction<CacheType>\n\t * \t) => Promise<void>}\n\t */\n\tabstract readonly execute: (\n\t\tclient: TriviousClient,\n\t\tinteraction: ChatInputCommandInteraction<CacheType>\n\t) => Promise<void>;\n\n\t/**\n\t * Reply to the interaction respecting command metadata and if the interaction has already been replied to.\n\t *\n\t * @async\n\t * @param {ChatInputCommandInteraction<CacheType>} interaction\n\t * @param {(MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions)} options\n\t * @returns {*}\n\t */\n\tasync reply(\n\t\tinteraction: ChatInputCommandInteraction<CacheType>,\n\t\toptions: MessagePayload | InteractionEditReplyOptions | InteractionReplyOptions\n\t) {\n\t\tif (interaction.replied || interaction.deferred) {\n\t\t\tawait interaction.editReply(options as InteractionEditReplyOptions);\n\t\t\treturn;\n\t\t}\n\n\t\tconst newOptions = { ...options } as InteractionReplyOptions;\n\t\tif (this.metadata.ephemeralReply) newOptions.flags = [\"Ephemeral\"];\n\n\t\tawait interaction.reply(newOptions);\n\t}\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CommandRegistry, a as ComponentRegistry, E as EventRegistry, M as ModuleRegistry, b as TriviousClientOptions, T as TriviousClient } from '../../index-
|
|
1
|
+
import { C as CommandRegistry, a as ComponentRegistry, E as EventRegistry, M as ModuleRegistry, b as TriviousClientOptions, T as TriviousClient } from '../../index-DQ3Y6DvJ.cjs';
|
|
2
2
|
import '../../shared/typings/registry.cjs';
|
|
3
3
|
import 'discord.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CommandRegistry, a as ComponentRegistry, E as EventRegistry, M as ModuleRegistry, b as TriviousClientOptions, T as TriviousClient } from '../../index-
|
|
1
|
+
import { C as CommandRegistry, a as ComponentRegistry, E as EventRegistry, M as ModuleRegistry, b as TriviousClientOptions, T as TriviousClient } from '../../index-Bf8pz7za.js';
|
|
2
2
|
import '../../shared/typings/registry.js';
|
|
3
3
|
import 'discord.js';
|
|
4
4
|
|
|
@@ -399,8 +399,9 @@ declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
|
|
|
399
399
|
* @typedef {Subcommand}
|
|
400
400
|
*/
|
|
401
401
|
declare abstract class Subcommand {
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
readonly data: SlashCommandSubcommandBuilder;
|
|
403
|
+
readonly metadata: SubcommandMetadata;
|
|
404
|
+
protected constructor(builder: SubcommandBuilder);
|
|
404
405
|
/**
|
|
405
406
|
* Function to execute the subcommand.
|
|
406
407
|
*
|
|
@@ -399,8 +399,9 @@ declare class SubcommandBuilder extends SlashCommandSubcommandBuilder {
|
|
|
399
399
|
* @typedef {Subcommand}
|
|
400
400
|
*/
|
|
401
401
|
declare abstract class Subcommand {
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
readonly data: SlashCommandSubcommandBuilder;
|
|
403
|
+
readonly metadata: SubcommandMetadata;
|
|
404
|
+
protected constructor(builder: SubcommandBuilder);
|
|
404
405
|
/**
|
|
405
406
|
* Function to execute the subcommand.
|
|
406
407
|
*
|
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, B as ButtonInteraction, y as ChatInputCommandInteraction, i as Command, j as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, w as Component, x as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, l as ContextMenuBuilder, k as ContextMenuCommand, F as ContextMenuCommandInteraction, r as ContextMenuMetadata, u as Event, D as ModalSubmitInteraction, v as Module, P as PermissionLevel, S as SlashCommand, z as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-
|
|
2
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, B as ButtonInteraction, y as ChatInputCommandInteraction, i as Command, j as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, w as Component, x as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, l as ContextMenuBuilder, k as ContextMenuCommand, F as ContextMenuCommandInteraction, r as ContextMenuMetadata, u as Event, D as ModalSubmitInteraction, v as Module, P as PermissionLevel, S as SlashCommand, z as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-DQ3Y6DvJ.cjs';
|
|
3
3
|
export { BaseRegistry } from './shared/typings/registry.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, B as ButtonInteraction, y as ChatInputCommandInteraction, i as Command, j as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, w as Component, x as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, l as ContextMenuBuilder, k as ContextMenuCommand, F as ContextMenuCommandInteraction, r as ContextMenuMetadata, u as Event, D as ModalSubmitInteraction, v as Module, P as PermissionLevel, S as SlashCommand, z as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-
|
|
2
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, B as ButtonInteraction, y as ChatInputCommandInteraction, i as Command, j as CommandBuilder, o as CommandInteraction, p as CommandMetadata, C as CommandRegistry, w as Component, x as ComponentBuilder, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, a as ComponentRegistry, e as ComponentType, l as ContextMenuBuilder, k as ContextMenuCommand, F as ContextMenuCommandInteraction, r as ContextMenuMetadata, u as Event, D as ModalSubmitInteraction, v as Module, P as PermissionLevel, S as SlashCommand, z as StringSelectMenuInteraction, m as Subcommand, n as SubcommandBuilder, q as SubcommandMetadata, T as TriviousClient, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from './index-Bf8pz7za.js';
|
|
3
3
|
export { BaseRegistry } from './shared/typings/registry.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-
|
|
1
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-DQ3Y6DvJ.cjs';
|
|
2
2
|
import 'discord.js';
|
|
3
3
|
import './registry.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-
|
|
1
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, r as ContextMenuMetadata, q as SubcommandMetadata } from '../../index-Bf8pz7za.js';
|
|
2
2
|
import 'discord.js';
|
|
3
3
|
import './registry.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-
|
|
2
|
+
export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-DQ3Y6DvJ.cjs';
|
|
3
3
|
import './registry.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'discord.js';
|
|
2
|
-
export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-
|
|
2
|
+
export { c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, h as deconstructCustomId } from '../../index-Bf8pz7za.js';
|
|
3
3
|
import './registry.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, u as Event, v as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-
|
|
1
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, u as Event, v as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-DQ3Y6DvJ.cjs';
|
|
2
2
|
export { BaseRegistry } from './registry.cjs';
|
|
3
3
|
import 'discord.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, u as Event, v as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-
|
|
1
|
+
export { A as AnyCommand, s as AnyCommandBuilder, t as AnyCommandMetadata, o as CommandInteraction, p as CommandMetadata, c as ComponentCustomIdTag, d as ComponentInteraction, f as ComponentMetadata, e as ComponentType, r as ContextMenuMetadata, u as Event, v as Module, P as PermissionLevel, q as SubcommandMetadata, b as TriviousClientOptions, h as deconstructCustomId, g as getPermissionLevel } from '../../index-Bf8pz7za.js';
|
|
2
2
|
export { BaseRegistry } from './registry.js';
|
|
3
3
|
import 'discord.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TriviousClient, P as PermissionLevel } from '../../index-
|
|
1
|
+
import { T as TriviousClient, P as PermissionLevel } from '../../index-DQ3Y6DvJ.cjs';
|
|
2
2
|
import { User, GuildMember, RESTPostAPIApplicationCommandsJSONBody } from 'discord.js';
|
|
3
3
|
import '../typings/registry.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TriviousClient, P as PermissionLevel } from '../../index-
|
|
1
|
+
import { T as TriviousClient, P as PermissionLevel } from '../../index-Bf8pz7za.js';
|
|
2
2
|
import { User, GuildMember, RESTPostAPIApplicationCommandsJSONBody } from 'discord.js';
|
|
3
3
|
import '../typings/registry.js';
|
|
4
4
|
|