reciple 1.0.6 → 1.0.9

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/bin/bin.js CHANGED
@@ -14,7 +14,8 @@ const Config_1 = require("./reciple/classes/Config");
14
14
  const Client_1 = require("./reciple/classes/Client");
15
15
  const fs_1 = require("fs");
16
16
  const fallout_utility_1 = require("fallout-utility");
17
- if ((0, fs_1.readdirSync)('./').length > 0 && !(0, fs_1.existsSync)('./reciple.yml')) {
17
+ const allowedFiles = ['node_modules', 'reciple.yml', 'package.json', 'package.lock.json'];
18
+ if ((0, fs_1.readdirSync)('./').filter(f => !f.startsWith('.') && allowedFiles.indexOf(f)).length > 0 && !(0, fs_1.existsSync)('./reciple.yml')) {
18
19
  const ask = (0, fallout_utility_1.input)('This directory does not contain reciple.yml. Would you like to init axis here? [y/n] ');
19
20
  if (ask !== 'y')
20
21
  process.exit(0);
@@ -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;
@@ -14,7 +14,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.loadModules = void 0;
16
16
  const fs_1 = require("fs");
17
- const MessageCommandBuilder_1 = require("./classes/builders/MessageCommandBuilder");
18
17
  const path_1 = __importDefault(require("path"));
19
18
  function loadModules(client) {
20
19
  var _a;
@@ -33,7 +32,7 @@ function loadModules(client) {
33
32
  module_ = require(modulePath);
34
33
  if (!module_.versions || !(typeof module_.versions === 'object' ? module_.versions : [module_.versions]).includes(client.version))
35
34
  throw new Error('Module versions is not defined or unsupported.');
36
- if (!module_.onStart(client))
35
+ if (!(yield Promise.resolve(module_.onStart(client))))
37
36
  throw new Error(script + ' onStart is not defined or returned false.');
38
37
  if (module_.commands) {
39
38
  for (const command of module_.commands) {
@@ -52,7 +51,7 @@ function loadModules(client) {
52
51
  logger.error(`A message command name is not defined in ${script}`);
53
52
  return false;
54
53
  }
55
- if (c instanceof MessageCommandBuilder_1.MessageCommandBuilder && c.options.length && c.options.some(o => !o.name)) {
54
+ if (c.type === 'MESSAGE_COMMAND' && c.options.length && c.options.some(o => !o.name)) {
56
55
  logger.error(`A message command option name is not defined in ${script}`);
57
56
  return false;
58
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
4
  "description": "A Discord.js bot",
5
5
  "author": "FalloutStudios",
6
6
  "license": "GPL-3.0",