xernerx 4.14.0 → 4.14.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/handlers/CommandHandler.js +1 -1
- package/dist/utils/ClientUtil.d.ts +2 -1
- package/dist/utils/ClientUtil.js +3 -0
- package/dist/utils/InteractionUtil.d.ts +1 -1
- package/dist/utils/InteractionUtil.js +7 -3
- package/dist/utils/MessageUtil.d.ts +1 -0
- package/dist/utils/MessageUtil.js +3 -0
- package/dist/validators/inhibitorValidations.d.ts +1 -1
- package/package.json +1 -1
|
@@ -273,7 +273,7 @@ export default class CommandHandler extends Handler {
|
|
|
273
273
|
await this.client.emit('commandStart', interaction);
|
|
274
274
|
const args = await interactionArguments(interaction, cmd);
|
|
275
275
|
interaction.util.parsed = {
|
|
276
|
-
alias: [interaction.commandName, args.group ||
|
|
276
|
+
alias: [interaction.commandName, args.group || null, args.subcommand || null].filter((x) => x).join(' '),
|
|
277
277
|
args: args.args,
|
|
278
278
|
};
|
|
279
279
|
cmd.util = interaction.util;
|
|
@@ -11,8 +11,9 @@ export default class ClientUtil extends Util {
|
|
|
11
11
|
constructor(client: XernerxClient);
|
|
12
12
|
setPresence(options: PresenceOptions): import("discord.js").ClientPresence | undefined;
|
|
13
13
|
private resolveCooldown;
|
|
14
|
-
resolveCommand(options: ResolveCommandOptions):
|
|
14
|
+
resolveCommand(options: ResolveCommandOptions): XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand | Collection<string, XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand>;
|
|
15
15
|
resolveChannel(query: string | Record<string, string>): Promise<import("discord.js").Channel | null>;
|
|
16
16
|
resolveGuild(query: string | Record<string, string>): Promise<import("discord.js").Guild | null>;
|
|
17
17
|
uptime(timestamp?: number | null): string;
|
|
18
|
+
commands(): ([string, XernerxMessageCommand] | [string, XernerxSlashCommand] | [string, XernerxContextCommand])[];
|
|
18
19
|
}
|
package/dist/utils/ClientUtil.js
CHANGED
|
@@ -18,7 +18,7 @@ export default class InteractionUtil extends Util {
|
|
|
18
18
|
send(content: any): Promise<import("discord.js").Message<false> | import("discord.js").Message<true> | undefined>;
|
|
19
19
|
reply(content: string | MessagePayload | InteractionReplyOptions | InteractionEditReplyOptions): Promise<import("discord.js").InteractionResponse<boolean> | import("discord.js").Message<boolean>>;
|
|
20
20
|
mimic(user: XernerxUser | string, interaction: MessageCreateOptions, options: MimicOptions): Promise<void>;
|
|
21
|
-
private commandName;
|
|
22
21
|
paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import("discord.js").Message<false> | import("discord.js").Message<true>>;
|
|
22
|
+
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxSlashCommand> | import("@discordjs/collection").Collection<string, import("../main.js").XernerxContextCommand>;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @format */
|
|
2
|
-
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, StringSelectMenuBuilder, } from 'discord.js';
|
|
2
|
+
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, InteractionType, StringSelectMenuBuilder, } from 'discord.js';
|
|
3
3
|
import Util from './Util.js';
|
|
4
4
|
import XernerxError from '../tools/XernerxError.js';
|
|
5
5
|
export default class InteractionUtil extends Util {
|
|
@@ -38,8 +38,6 @@ export default class InteractionUtil extends Util {
|
|
|
38
38
|
webhook.delete().catch(() => true);
|
|
39
39
|
}, options.timeout);
|
|
40
40
|
}
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
commandName() { }
|
|
43
41
|
async paginator(embeds, options = {}) {
|
|
44
42
|
let buttonRow, menuRow;
|
|
45
43
|
if (embeds.length <= 0)
|
|
@@ -120,4 +118,10 @@ export default class InteractionUtil extends Util {
|
|
|
120
118
|
});
|
|
121
119
|
});
|
|
122
120
|
}
|
|
121
|
+
commands() {
|
|
122
|
+
if (this.interaction.type == InteractionType.ApplicationCommand)
|
|
123
|
+
return this.client.commands.slash;
|
|
124
|
+
else
|
|
125
|
+
return this.client.commands.context;
|
|
126
|
+
}
|
|
123
127
|
}
|
|
@@ -19,5 +19,6 @@ export default class MessageUtil extends Util {
|
|
|
19
19
|
reply(content: string | MessagePayload | MessageReplyOptions | MessageEditOptions): Promise<import("discord.js").Message<boolean> | null>;
|
|
20
20
|
mimic(user: XernerxUser | string, message: MessageCreateOptions, options: MimicOptions): Promise<void>;
|
|
21
21
|
paginator(embeds: Array<EmbedBuilder>, options?: PaginatorOptions): Promise<void | import("discord.js").Message<boolean> | null>;
|
|
22
|
+
commands(): import("@discordjs/collection").Collection<string, import("../main.js").XernerxMessageCommand>;
|
|
22
23
|
}
|
|
23
24
|
export {};
|
|
@@ -6,4 +6,4 @@ import XernerxSlashCommand from '../build/XernerxSlashCommand.js';
|
|
|
6
6
|
import { XernerxMessage, XernerxMessageContextInteraction, XernerxSlashInteraction, XernerxUserContextInteraction } from '../types/extenders.js';
|
|
7
7
|
import { InhibitorType, XernerxInteraction } from '../types/types.js';
|
|
8
8
|
export declare function inhibitorValidation(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, args?: SlashCommandArguments | MessageCommandArguments | ContextCommandArguments<'user' | 'message'> | null, cmd?: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand, type?: 'pre' | 'check' | 'post'): Promise<boolean>;
|
|
9
|
-
export declare function inhibitorArguments(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null, type: InhibitorType): import("../types/extenders.js").XernerxUser | import("discord.js").GuildMember | import("discord.js").Guild | import("discord.js").TextBasedChannel |
|
|
9
|
+
export declare function inhibitorArguments(event: XernerxMessage | XernerxInteraction<XernerxSlashInteraction | XernerxUserContextInteraction | XernerxMessageContextInteraction>, cmd: XernerxContextCommand | XernerxMessageCommand | XernerxSlashCommand | null, type: InhibitorType): import("../types/extenders.js").XernerxUser | import("discord.js").GuildMember | import("discord.js").Guild | import("discord.js").TextBasedChannel | XernerxSlashCommand | XernerxContextCommand | XernerxMessageCommand | import("discord.js").APIInteractionGuildMember | null | undefined;
|