xernerx 2.4.0 → 2.4.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/main.js CHANGED
@@ -8,7 +8,8 @@ const { Client } = require('./models/Client.js'),
8
8
  { ContextMenuCommand } = require('./models/commands/ContextMenuCommand.js'),
9
9
  pkg = require('./package.json'),
10
10
  Dumfunctions = require('dumfunctions'),
11
- Discord = require('discord.js');
11
+ Discord = require('discord.js'),
12
+ i18next = require('i18next');
12
13
 
13
14
  module.exports = {
14
15
  // Client
@@ -29,6 +30,7 @@ module.exports = {
29
30
 
30
31
  // Discord
31
32
  Discord,
33
+ i18next,
32
34
  functions: Dumfunctions,
33
35
 
34
36
  // Details
@@ -79,30 +79,38 @@ function commandName(interaction, cmd) {
79
79
  if (option?.options?.length > 0) {
80
80
  option?.options?.map(opt => {
81
81
  if (!opt.type) {
82
- commandInfo.name = command?.data?.name + " " + option?.name + " " + opt?.name;
83
-
84
- commandInfo.description = opt.description;
82
+ commandInfo = {
83
+ name: command?.data?.name + " " + option?.name + " " + opt?.name,
84
+ description: opt.description,
85
+ category: command.category
86
+ }
85
87
  }
86
88
 
87
89
  else {
88
- commandInfo.name = command?.data?.name + " " + option?.name;
89
-
90
- commandInfo.description = option?.description;
90
+ commandInfo = {
91
+ name: command?.data?.name + " " + option?.name,
92
+ description: option?.description,
93
+ category: command.category
94
+ }
91
95
  }
92
96
  })
93
97
  }
94
98
 
95
99
  else {
96
- commandInfo.name = command?.data?.name + " " + option?.name;
97
-
98
- commandInfo.description = option?.description;
100
+ commandInfo = {
101
+ name: command?.data?.name + " " + option?.name,
102
+ description: option?.description,
103
+ category: command.category
104
+ }
99
105
  }
100
106
  }
101
107
 
102
108
  else {
103
- commandInfo.name = command?.data?.name || command?.id;
104
-
105
- commandInfo.description = command?.data?.description || command?.description;
109
+ commandInfo = {
110
+ name: command?.data?.name || command?.id,
111
+ description: command?.data?.description || command?.description,
112
+ category: command.category
113
+ }
106
114
  }
107
115
  })
108
116
  }
@@ -6,27 +6,31 @@ class LanguageHandler {
6
6
  constructor(client) {
7
7
  this.client = client;
8
8
 
9
- i.init(this.client.settings.language)
9
+ i.init(this.client.language);
10
10
 
11
- this.client.languages = []
11
+ this.client.languages = [];
12
12
  }
13
13
 
14
14
  loadAllLanguages(path, deep = true, overwrite = true) {
15
- let langs = [];
15
+
16
16
 
17
17
  const languages = fs.readdirSync(path).filter(file => file.endsWith('.json'));
18
18
 
19
19
  for (const file of languages) {
20
20
  const language = require(`${require("path").resolve(path)}/${file}`);
21
21
 
22
- i.addResourceBundle(file.replace('.json', ""), this.client.language.ns, language, deep, overwrite);
22
+ i.addResourceBundle(
23
+ file.replace('.json', ""),
24
+ ...this.client.language.ns,
25
+ language,
26
+ deep,
27
+ overwrite
28
+ );
23
29
 
24
30
  this.client.languages.push(file.replace('.json', ""));
25
-
26
- langs.push(file.replace('.json', ""));
27
31
  }
28
32
 
29
- if (this.client.settings.logging) console.info(logStyle(`Loaded languages: ${langs.join(', ')}`, 'text', 'purple'))
33
+ if (this.client.settings.logging) console.info(logStyle(`Loaded languages: ${this.client.languages.join(', ')}`, 'text', 'purple'));
30
34
  }
31
35
  }
32
36
 
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
- "name": "xernerx",
3
- "version": "2.4.0",
4
- "description": "A bot framework for discord.js. [BETA]",
5
- "main": "main.js",
6
- "scripts": {
7
- "test": "echo Setup a bot then start the bot."
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/TheDummi/xernerx.git"
12
- },
13
- "author": "Dummi",
14
- "license": "MIT",
15
- "bugs": {
16
- "url": "https://github.com/TheDummi/xernerx/issues"
17
- },
18
- "homepage": "https://github.com/TheDummi/xernerx#readme",
19
- "dependencies": {
20
- "@discordjs/rest": "1.0.1",
21
- "@sapphire/shapeshift": "3.5.1",
22
- "discord-api-types": "^0.37.3",
23
- "discord.js": "^14.2.0",
24
- "dumfunctions": "^1.0.7",
25
- "i18next": "^21.9.1"
26
- },
27
- "packageManager": "npm@8.5.5"
2
+ "name": "xernerx",
3
+ "version": "2.4.3",
4
+ "description": "A bot framework for discord.js. [BETA]",
5
+ "main": "main.js",
6
+ "scripts": {
7
+ "test": "echo Setup a bot then start the bot."
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/TheDummi/xernerx.git"
12
+ },
13
+ "author": "Dummi",
14
+ "license": "MIT",
15
+ "bugs": {
16
+ "url": "https://github.com/TheDummi/xernerx/issues"
17
+ },
18
+ "homepage": "https://github.com/TheDummi/xernerx#readme",
19
+ "dependencies": {
20
+ "@discordjs/rest": "1.0.1",
21
+ "@sapphire/shapeshift": "3.5.1",
22
+ "discord-api-types": "^0.37.3",
23
+ "discord.js": "^14.2.0",
24
+ "dumfunctions": "^1.0.7",
25
+ "i18next": "^21.9.1"
26
+ },
27
+ "packageManager": "npm@8.5.5"
28
28
  }