reciple 3.1.0 → 3.1.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </h1>
5
5
 
6
6
  <h3 align="center">
7
- <a href="https://npmjs.org/package/reciple">
7
+ <a href="https://npmjs.org/package/reciple">
8
8
  <img src="https://img.shields.io/npm/v/reciple?label=latest%20npm%20release%20">
9
9
  </a>
10
10
  <a href="https://github.com/FalloutStudios/Reciple/blob/main/LICENSE">
@@ -14,11 +14,13 @@
14
14
  <img src="https://www.codefactor.io/repository/github/falloutstudios/reciple/badge/main">
15
15
  </a>
16
16
 
17
- A simple Dicord.js handler that just works.<h3>
17
+ A simple Dicord.js handler that just works.
18
+ </h3>
18
19
 
19
20
  ****
20
21
 
21
22
  ## Installation
23
+
22
24
  To install the bot, run the following command in your terminal:
23
25
 
24
26
  ```bash
@@ -58,6 +60,9 @@ You can override the given token using your terminal
58
60
  ```bash
59
61
  npx reciple --token "YOUR_TOKEN_HERE"
60
62
  ```
63
+
64
+ Use env variable
65
+
61
66
  ```bash
62
67
  npx reciple --token "env:TOKEN_VARIABLE"
63
68
  ```
package/bin/bin.js CHANGED
@@ -9,12 +9,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  step((generator = generator.apply(thisArg, _arguments || [])).next());
10
10
  });
11
11
  };
12
+ var __importDefault = (this && this.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
12
15
  var _a, _b;
13
16
  Object.defineProperty(exports, "__esModule", { value: true });
14
17
  const RecipleClient_1 = require("./reciple/classes/RecipleClient");
15
18
  const RecipleConfig_1 = require("./reciple/classes/RecipleConfig");
16
19
  const flags_1 = require("./reciple/flags");
17
20
  const version_1 = require("./reciple/version");
21
+ const chalk_1 = __importDefault(require("chalk"));
18
22
  const fallout_utility_1 = require("fallout-utility");
19
23
  const fs_1 = require("fs");
20
24
  require("dotenv/config");
@@ -28,7 +32,15 @@ if ((0, fs_1.readdirSync)('./').filter(f => !f.startsWith('.') && allowedFiles.i
28
32
  if (ask.toString().toLowerCase() !== 'y')
29
33
  process.exit(0);
30
34
  }
31
- const config = new RecipleConfig_1.RecipleConfig((_b = flags_1.flags.config) !== null && _b !== void 0 ? _b : './reciple.yml').parseConfig().getConfig();
35
+ let configParser;
36
+ try {
37
+ configParser = new RecipleConfig_1.RecipleConfig((_b = flags_1.flags.config) !== null && _b !== void 0 ? _b : './reciple.yml').parseConfig();
38
+ }
39
+ catch (err) {
40
+ console.error(`${chalk_1.default.bold.red('Config Error')}: ${chalk_1.default.white(err.message)}`);
41
+ process.exit(1);
42
+ }
43
+ const config = configParser.getConfig();
32
44
  const client = new RecipleClient_1.RecipleClient(Object.assign({ config: config }, config.client));
33
45
  if (config.fileLogging.clientLogs)
34
46
  client.logger.info('Reciple Client v' + version_1.version + ' is starting...');
@@ -192,7 +192,7 @@ class RecipleClient extends discord_js_1.Client {
192
192
  return;
193
193
  if (command.validateOptions) {
194
194
  if (commandOptions.some(o => o.invalid)) {
195
- if (!(command === null || command === void 0 ? void 0 : command.halt) || !(yield command.halt({ executeData, reason: commands_1.RecipleHaltedCommandReason.InvalidArguments, invalidArguments: new MessageCommandOptionManager_1.MessageCommandOptionManager(executeData.options.filter(o => o.invalid)) }))) {
195
+ if (!(yield this._haltCommand(command, { executeData, reason: commands_1.RecipleHaltedCommandReason.InvalidArguments, invalidArguments: new MessageCommandOptionManager_1.MessageCommandOptionManager(executeData.options.filter(o => o.invalid)) }))) {
196
196
  message.reply(this.getMessage('invalidArguments', 'Invalid argument(s) given.')).catch(er => this._replyError(er));
197
197
  }
198
198
  return;
@@ -348,12 +348,12 @@ class RecipleClient extends discord_js_1.Client {
348
348
  return (_a = (command.halt
349
349
  ? yield (command.builder == builders_1.RecipleCommandBuilderType.InteractionCommand
350
350
  ? Promise.resolve(command.halt(haltData))
351
- : Promise.resolve(command.halt(haltData))).catch(() => false)
351
+ : Promise.resolve(command.halt(haltData))).catch(err => { throw err; })
352
352
  : false)) !== null && _a !== void 0 ? _a : false;
353
353
  }
354
354
  catch (err) {
355
355
  if (this.isClientLogsEnabled()) {
356
- this.logger.error(`Halt command "${command.name}" execute error`);
356
+ this.logger.error(`An error occured executing command halt for "${command.name}"`);
357
357
  this.logger.error(err);
358
358
  }
359
359
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "3.1.0",
3
+ "version": "3.1.3",
4
4
  "bin": "bin/bin.js",
5
5
  "license": "GPL-3.0",
6
6
  "main": "bin/index.js",
@@ -23,7 +23,7 @@
23
23
  "build": "yarn clean && yarn exec tsc",
24
24
  "build:publish": "yarn build && yarn npm publish && yarn build:docs && yarn publish:docs",
25
25
  "build:pub-prerelease": "yarn build && yarn publish --tag pre",
26
- "build:docs": "yarn workspace docs build",
26
+ "build:docs": "yarn exec typedoc --tsconfig ./docs/typedoc.json",
27
27
  "update:docs": "yarn workspace docs update",
28
28
  "test": "yarn build && yarn test:start",
29
29
  "test:start": "cd test && yarn exec reciple -D",
@@ -50,15 +50,20 @@
50
50
  "chalk": "4.1.2",
51
51
  "commander": "^9.4.0",
52
52
  "dotenv": "^16.0.1",
53
- "fallout-utility": "^1.4.2",
53
+ "fallout-utility": "^1.4.3",
54
54
  "semver": "^7.3.7",
55
55
  "wildcard-match": "^5.1.2",
56
56
  "yaml": "^2.1.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/node": "^18.0.6",
59
+ "@types/node": "^18.6.1",
60
60
  "@types/semver": "^7.3.10",
61
+ "better-docs": "^2.7.2",
61
62
  "discord.js": "^14.0.3",
63
+ "typedoc": "^0.23.9",
64
+ "typedoc-plugin-discord-types": "^1.0.2",
65
+ "typedoc-plugin-djs-links": "^1.2.0",
66
+ "typedoc-plugin-mdn-links": "^2.0.0",
62
67
  "typescript": "^4.7.4"
63
68
  },
64
69
  "peerDependencies": {
@@ -117,4 +117,4 @@ ignoredFiles: []
117
117
  modulesFolder: 'modules'
118
118
 
119
119
  # Current version
120
- version: VERSION
120
+ version: ^VERSION