reciple 1.0.4 → 1.0.7

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.
@@ -125,21 +125,25 @@ class RecipleClient extends discord_js_1.Client {
125
125
  });
126
126
  }
127
127
  _commandExecuteError(err, command) {
128
- var _a, _b, _c;
128
+ var _a, _b, _c, _d, _e;
129
129
  return __awaiter(this, void 0, void 0, function* () {
130
130
  this.logger.error(`An error occured executing ${command.builder.type == 'MESSAGE_COMMAND' ? 'message' : 'interaction'} command "${command.builder.name}"`);
131
131
  this.logger.error(err);
132
132
  if (!err || !command)
133
133
  return;
134
134
  if (command === null || command === void 0 ? void 0 : command.message) {
135
- yield command.message.reply(((_a = this.config) === null || _a === void 0 ? void 0 : _a.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
135
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.commands.messageCommand.replyOnError))
136
+ return;
137
+ yield command.message.reply(((_b = this.config) === null || _b === void 0 ? void 0 : _b.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
136
138
  }
137
139
  else if (command === null || command === void 0 ? void 0 : command.interaction) {
140
+ if (!((_c = this.config) === null || _c === void 0 ? void 0 : _c.commands.interactionCommand.replyOnError))
141
+ return;
138
142
  if (!(command === null || command === void 0 ? void 0 : command.interaction.deferred)) {
139
- yield command.interaction.reply(((_b = this.config) === null || _b === void 0 ? void 0 : _b.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
143
+ yield command.interaction.reply(((_d = this.config) === null || _d === void 0 ? void 0 : _d.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
140
144
  }
141
145
  else {
142
- yield command.interaction.editReply(((_c = this.config) === null || _c === void 0 ? void 0 : _c.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
146
+ yield command.interaction.editReply(((_e = this.config) === null || _e === void 0 ? void 0 : _e.messages.error) || 'An error occured.').catch((e) => this.logger.error(e));
143
147
  }
144
148
  }
145
149
  });
@@ -1,14 +1,16 @@
1
- import { ClientOptions, MessageOptions, PermissionResolvable } from 'discord.js';
1
+ import { ClientOptions, InteractionReplyOptions, MessageOptions, PermissionResolvable } from 'discord.js';
2
2
  export interface Config {
3
3
  token: string;
4
4
  prefix: string;
5
5
  commands: {
6
6
  messageCommand: {
7
7
  enabled: boolean;
8
+ replyOnError: boolean;
8
9
  commandArgumentSeparator: string;
9
10
  };
10
11
  interactionCommand: {
11
12
  enabled: boolean;
13
+ replyOnError: boolean;
12
14
  registerCommands: boolean;
13
15
  guilds: string[] | string;
14
16
  };
@@ -40,7 +42,7 @@ export interface Config {
40
42
  };
41
43
  client: ClientOptions;
42
44
  messages: {
43
- [key: string]: MessageOptions | string;
45
+ [key: string]: MessageOptions | InteractionReplyOptions | string;
44
46
  };
45
47
  modulesFolder: string;
46
48
  version?: string;
@@ -5,9 +5,9 @@ function isIgnoredChannel(channelId, ignoredChannelsConfig) {
5
5
  if (!(ignoredChannelsConfig === null || ignoredChannelsConfig === void 0 ? void 0 : ignoredChannelsConfig.enabled))
6
6
  return false;
7
7
  if (ignoredChannelsConfig.channels.includes(channelId) && !ignoredChannelsConfig.convertToAllowList)
8
- return false;
8
+ return true;
9
9
  if (!ignoredChannelsConfig.channels.includes(channelId) && ignoredChannelsConfig.convertToAllowList)
10
- return false;
11
- return true;
10
+ return true;
11
+ return false;
12
12
  }
13
13
  exports.isIgnoredChannel = isIgnoredChannel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "1.0.4",
3
+ "version": "1.0.7",
4
4
  "description": "A Discord.js bot",
5
5
  "author": "FalloutStudios",
6
6
  "license": "GPL-3.0",
@@ -4,9 +4,11 @@ prefix: '!'
4
4
  commands:
5
5
  messageCommand:
6
6
  enabled: true
7
+ replyOnError: false
7
8
  commandArgumentSeparator: ' '
8
9
  interactionCommand:
9
10
  enabled: true
11
+ replyOnError: false
10
12
  registerCommands: true
11
13
  guilds: []
12
14
 
@@ -42,8 +44,13 @@ client:
42
44
  - 'GUILD_MESSAGE_REACTIONS'
43
45
 
44
46
  messages:
45
- noPermission: 'You do not have permission to use this command.'
46
47
  notEnoughArguments: 'Not enough arguments.'
48
+ noPermission:
49
+ content: 'You do not have permission to use this command.'
50
+ ephemeral: true
51
+ error:
52
+ content: 'An error occurred.'
53
+ ephemeral: true
47
54
 
48
55
  modulesFolder: 'modules'
49
56