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.
@@ -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(`Command "${(_a = command.name) !== null && _a !== void 0 ? _a : 'unknown'}" has an invalid builder.`);
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 (commandOptions.some(o => o.invalid)) {
128
- yield message.reply(this.getMessage('invalidArguments', 'Invalid argument(s) given.'));
129
- return;
130
- }
131
- if (commandOptions.some(o => o.missing)) {
132
- yield message.reply(this.getMessage('notEnoughArguments', 'Not enough arguments.'));
133
- return;
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: string;
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: string;
21
+ readonly builder = "MESSAGE_COMMAND";
22
22
  name: string;
23
23
  description: string;
24
24
  options: MessageCommandOptionBuilder[];
@@ -5,7 +5,7 @@ class MessageCommandOptionBuilder {
5
5
  constructor() {
6
6
  this.name = '';
7
7
  this.description = '';
8
- this.required = true;
8
+ this.required = false;
9
9
  this.validator = () => true;
10
10
  }
11
11
  setName(name) {
@@ -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} to ${permissions.join(', ')}`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "1.5.0",
3
+ "version": "1.5.3",
4
4
  "description": "A Discord.js bot",
5
5
  "author": "FalloutStudios",
6
6
  "license": "GPL-3.0",
@@ -37,4 +37,4 @@
37
37
  "@types/semver": "^7.3.10",
38
38
  "typescript": "^4.7.4"
39
39
  }
40
- }
40
+ }