reciple 1.0.4 → 1.0.5
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
|
-
|
|
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(((
|
|
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(((
|
|
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
|
});
|
|
@@ -5,10 +5,12 @@ export interface Config {
|
|
|
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
|
};
|
package/package.json
CHANGED