reciple 1.5.0 → 1.5.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/bin/reciple/classes/Client.js +10 -8
- package/bin/reciple/classes/builders/InteractionCommandBuilder.d.ts +1 -1
- package/bin/reciple/classes/builders/MessageCommandBuilder.d.ts +1 -1
- package/bin/reciple/classes/builders/MessageCommandOptionBuilder.js +1 -1
- package/bin/reciple/registerInteractionCommands.js +1 -1
- package/package.json +2 -2
|
@@ -95,7 +95,7 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
95
95
|
this.commands.INTERACTION_COMMANDS[command.name] = command;
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
|
-
this.logger.error(`
|
|
98
|
+
this.logger.error(`Unknow command "${(_a = typeof command) !== null && _a !== void 0 ? _a : 'unknown'}".`);
|
|
99
99
|
}
|
|
100
100
|
return this;
|
|
101
101
|
}
|
|
@@ -124,13 +124,15 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
124
124
|
|| (0, isIgnoredChannel_1.isIgnoredChannel)(message.channelId, this.config.ignoredChannels))
|
|
125
125
|
return;
|
|
126
126
|
const commandOptions = command.getCommandOptionValues(parseCommand);
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
if (command.validateOptions) {
|
|
128
|
+
if (commandOptions.some(o => o.invalid)) {
|
|
129
|
+
yield message.reply(this.getMessage('invalidArguments', 'Invalid argument(s) given.')).catch(() => { });
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (commandOptions.some(o => o.missing)) {
|
|
133
|
+
yield message.reply(this.getMessage('notEnoughArguments', 'Not enough arguments.')).catch(() => { });
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
134
136
|
}
|
|
135
137
|
const options = {
|
|
136
138
|
message: message,
|
|
@@ -8,7 +8,7 @@ export interface RecipleInteractionCommandExecute {
|
|
|
8
8
|
client: RecipleClient;
|
|
9
9
|
}
|
|
10
10
|
export declare class InteractionCommandBuilder extends SlashCommandBuilder {
|
|
11
|
-
readonly builder
|
|
11
|
+
readonly builder = "INTERACTION_COMMAND";
|
|
12
12
|
requiredPermissions: (PermissionFlags | PermissionString)[];
|
|
13
13
|
allowExecuteInDM: boolean;
|
|
14
14
|
execute: (options: RecipleInteractionCommandExecute) => void;
|
|
@@ -18,7 +18,7 @@ export interface MessageCommandValidatedOption {
|
|
|
18
18
|
missing: boolean;
|
|
19
19
|
}
|
|
20
20
|
export declare class MessageCommandBuilder {
|
|
21
|
-
readonly builder
|
|
21
|
+
readonly builder = "MESSAGE_COMMAND";
|
|
22
22
|
name: string;
|
|
23
23
|
description: string;
|
|
24
24
|
options: MessageCommandOptionBuilder[];
|
|
@@ -24,7 +24,7 @@ function registerInteractionCommands(client, cmds, overwriteGuilds) {
|
|
|
24
24
|
undefined)) !== null && _d !== void 0 ? _d : cmd.requiredPermissions;
|
|
25
25
|
cmd.setRequiredPermissions(permissions);
|
|
26
26
|
client.commands.INTERACTION_COMMANDS[cmd.name] = cmd;
|
|
27
|
-
client.logger.debug(`Set required permissions for ${cmd.name}
|
|
27
|
+
client.logger.debug(`Set required permissions for ${cmd.name}`);
|
|
28
28
|
return cmd.toJSON();
|
|
29
29
|
}
|
|
30
30
|
return c.toJSON();
|
package/package.json
CHANGED