reciple 1.6.0 → 1.6.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.
|
@@ -51,15 +51,25 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
loadModules() {
|
|
54
|
+
var _a, _b;
|
|
54
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
for (
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
for (let m in this.modules) {
|
|
57
|
+
const module_ = this.modules[m];
|
|
58
|
+
if (typeof ((_a = module_.script) === null || _a === void 0 ? void 0 : _a.onLoad) === 'function') {
|
|
59
|
+
yield Promise.resolve(module_.script.onLoad(this)).catch(err => {
|
|
60
|
+
var _a;
|
|
61
|
+
this.logger.error(`Error loading ${(_a = module_.info.filename) !== null && _a !== void 0 ? _a : 'unknown module'}:`);
|
|
62
|
+
this.logger.error(err);
|
|
63
|
+
this.modules = this.modules.filter((r, i) => i.toString() !== m.toString());
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
if (typeof ((_b = module_.script) === null || _b === void 0 ? void 0 : _b.commands) !== 'undefined') {
|
|
67
|
+
for (const command of module_.script.commands) {
|
|
68
|
+
this.addCommand(command);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
58
71
|
}
|
|
59
72
|
this.logger.info(`${this.modules.length} modules loaded.`);
|
|
60
|
-
for (const command of this.modules.map(m => { var _a; return (_a = m.script.commands) !== null && _a !== void 0 ? _a : []; })[0]) {
|
|
61
|
-
this.addCommand(command);
|
|
62
|
-
}
|
|
63
73
|
this.logger.info(`${Object.keys(this.commands.MESSAGE_COMMANDS).length} message commands loaded.`);
|
|
64
74
|
this.logger.info(`${Object.keys(this.commands.INTERACTION_COMMANDS).length} interaction commands loaded.`);
|
|
65
75
|
if (!this.config.commands.interactionCommand.registerCommands)
|
|
@@ -198,12 +208,12 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
198
208
|
if (command === null || command === void 0 ? void 0 : command.message) {
|
|
199
209
|
if (!this.config.commands.messageCommand.replyOnError)
|
|
200
210
|
return;
|
|
201
|
-
yield command.message.reply(this.getMessage('error', 'An error occurred.')).catch(
|
|
211
|
+
yield command.message.reply(this.getMessage('error', 'An error occurred.')).catch(e => this.logger.debug(e));
|
|
202
212
|
}
|
|
203
213
|
else if (command === null || command === void 0 ? void 0 : command.interaction) {
|
|
204
214
|
if (!this.config.commands.interactionCommand.replyOnError)
|
|
205
215
|
return;
|
|
206
|
-
yield command.interaction.followUp(this.getMessage('error', 'An error occurred.')).catch(
|
|
216
|
+
yield command.interaction.followUp(this.getMessage('error', 'An error occurred.')).catch(e => this.logger.debug(e));
|
|
207
217
|
}
|
|
208
218
|
});
|
|
209
219
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reciple",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "A Discord.js bot",
|
|
5
5
|
"author": "FalloutStudios",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"clean": "rm -rf bin",
|
|
23
23
|
"build": "yarn clean && npx tsc && npm un reciple -g && npm i ./ -g",
|
|
24
24
|
"build:publish": "yarn run build && yarn publish",
|
|
25
|
-
"test": "yarn run build && yarn test:
|
|
25
|
+
"test": "yarn run build && yarn test:start",
|
|
26
26
|
"test:start": "cd test && npx reciple"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|