reciple 5.5.0 → 5.5.2

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/dist/cjs/bin.js CHANGED
@@ -34,7 +34,7 @@ const client = new RecipleClient_1.RecipleClient({ config: config, ...config.cli
34
34
  if (config.fileLogging.clientLogs)
35
35
  client.logger.info('Starting Reciple client v' + version_1.rawVersion);
36
36
  (async () => {
37
- await client.startModules((0, discord_js_1.normalizeArray)(config.modulesFolder));
37
+ await client.startModules((0, discord_js_1.normalizeArray)([config.modulesFolder]));
38
38
  client.on('ready', async () => {
39
39
  if (client.isClientLogsEnabled())
40
40
  client.logger.warn(`Logged in as ${client.user?.tag || 'Unknown'}!`);
@@ -73,7 +73,7 @@ class RecipleClient extends discord_js_1.Client {
73
73
  this.modules = this.modules.filter((_r, i) => i.toString() !== m.toString());
74
74
  });
75
75
  }
76
- if (typeof module_.script?.commands !== 'undefined') {
76
+ if (module_.script?.commands && Array.isArray(module_.script?.commands)) {
77
77
  for (const command of module_.script.commands) {
78
78
  this.addCommand(command);
79
79
  }
@@ -81,13 +81,13 @@ class RecipleClient extends discord_js_1.Client {
81
81
  }
82
82
  if (this.isClientLogsEnabled()) {
83
83
  this.logger.info(`${this.modules.length} modules loaded.`);
84
- this.logger.info(`${Object.keys(this.commands.messageCommands).length} message commands loaded.`);
85
- this.logger.info(`${Object.keys(this.commands.slashCommands).length} slash commands loaded.`);
84
+ this.logger.info(`${this.commands.messageCommands.size} message commands loaded.`);
85
+ this.logger.info(`${this.commands.slashCommands.size} slash commands loaded.`);
86
86
  }
87
87
  if (this.config.commands.slashCommand.registerCommands) {
88
88
  await (0, registerApplicationCommands_1.registerApplicationCommands)({
89
89
  client: this,
90
- commands: [...Object.values(this.commands.slashCommands), ...this.additionalApplicationCommands],
90
+ commands: [...this.commands.slashCommands.toJSON(), ...this.additionalApplicationCommands],
91
91
  guilds: this.config.commands.slashCommand.guilds
92
92
  });
93
93
  }
@@ -122,7 +122,7 @@ class RecipleClient extends discord_js_1.Client {
122
122
  if (registerCommands)
123
123
  await (0, registerApplicationCommands_1.registerApplicationCommands)({
124
124
  client: this,
125
- commands: [...Object.values(this.commands.slashCommands), ...this.additionalApplicationCommands],
125
+ commands: [...this.commands.slashCommands.toJSON(), ...this.additionalApplicationCommands],
126
126
  guilds: this.config.commands.slashCommand.guilds
127
127
  });
128
128
  }
@@ -9,11 +9,10 @@ const SlashCommandBuilder_1 = require("./classes/builders/SlashCommandBuilder");
9
9
  */
10
10
  async function registerApplicationCommands(options) {
11
11
  const client = options.client;
12
- const guilds = (0, discord_js_1.normalizeArray)(options.guilds);
13
- const commands = Object.values(options.commands ?? client.commands.slashCommands).map(cmd => {
14
- if (typeof cmd?.toJSON == 'undefined')
15
- return cmd;
16
- cmd = cmd;
12
+ const guilds = (0, discord_js_1.normalizeArray)([options.guilds]);
13
+ const commands = options.commands ?? client.commands.slashCommands.toJSON().map(cmd => {
14
+ if (cmd?.toJSON === undefined)
15
+ return (cmd);
17
16
  if (SlashCommandBuilder_1.SlashCommandBuilder.isSlashCommandBuilder(cmd) && client.config.commands.slashCommand.setRequiredPermissions) {
18
17
  const permissions = client.config.commands.slashCommand.permissions.enabled
19
18
  ? client.config.commands.slashCommand.permissions.commands.find(cmd_ => cmd_.command.toLowerCase() === cmd.name.toLowerCase())?.permissions
@@ -23,7 +22,7 @@ async function registerApplicationCommands(options) {
23
22
  if (client.isClientLogsEnabled())
24
23
  client.logger.debug(`Set required permissions for ${cmd.name}`);
25
24
  }
26
- client.commands.slashCommands.set(cmd.name, cmd);
25
+ console.log(cmd);
27
26
  }
28
27
  return cmd.toJSON();
29
28
  }) ?? [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reciple",
3
- "version": "5.5.0",
3
+ "version": "5.5.2",
4
4
  "bin": "dist/cjs/bin.js",
5
5
  "license": "GPL-3.0",
6
6
  "main": "dist/cjs/index.js",
@@ -56,7 +56,7 @@
56
56
  "@discordjs/docgen": "^0.12.1",
57
57
  "@types/node": "^18.7.18",
58
58
  "@types/semver": "^7.3.12",
59
- "discord.js": "^14.3.0",
59
+ "discord.js": "^14.4.0",
60
60
  "rimraf": "^3.0.2",
61
61
  "typedoc-plugin-discord-types": "^1.0.2",
62
62
  "typedoc-plugin-djs-links": "^1.2.0",