xernerx 2.1.0 → 2.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
Binary file
package/main.js CHANGED
@@ -1,36 +1,36 @@
1
- const { Client } = require('./models/Client.js'),
2
- { CommandHandler } = require('./models/handlers/CommandHandler.js'),
3
- { EventHandler } = require('./models/handlers/EventHandler.js'),
4
- { MessageCommand } = require('./models/commands/MessageCommand.js'),
5
- { InteractionCommand } = require('./models/commands/InteractionCommand.js'),
6
- { Event } = require('./models/commands/Event.js'),
7
- { LanguageHandler } = require('./models/handlers/LanguageHandler.js'),
8
- { ContextMenuCommand } = require('./models/commands/ContextMenuCommand.js'),
9
- pkg = require('./package.json'),
10
- Dumfunctions = require('dumfunctions'),
11
- Discord = require('discord.js');
12
-
13
- module.exports = {
14
- // Client
15
- Client,
16
-
17
- // Handlers
18
- CommandHandler,
19
- EventHandler,
20
- LanguageHandler,
21
-
22
- // Commands
23
- MessageCommand,
24
- InteractionCommand,
25
- ContextMenuCommand,
26
-
27
- // Events
28
- Event,
29
-
30
- // Discord
31
- Discord,
32
- functions: Dumfunctions,
33
-
34
- // Details
35
- version: pkg.version,
1
+ const { Client } = require('./models/Client.js'),
2
+ { CommandHandler } = require('./models/handlers/CommandHandler.js'),
3
+ { EventHandler } = require('./models/handlers/EventHandler.js'),
4
+ { MessageCommand } = require('./models/commands/MessageCommand.js'),
5
+ { InteractionCommand } = require('./models/commands/InteractionCommand.js'),
6
+ { Event } = require('./models/commands/Event.js'),
7
+ { LanguageHandler } = require('./models/handlers/LanguageHandler.js'),
8
+ { ContextMenuCommand } = require('./models/commands/ContextMenuCommand.js'),
9
+ pkg = require('./package.json'),
10
+ Dumfunctions = require('dumfunctions'),
11
+ Discord = require('discord.js');
12
+
13
+ module.exports = {
14
+ // Client
15
+ Client,
16
+
17
+ // Handlers
18
+ CommandHandler,
19
+ EventHandler,
20
+ LanguageHandler,
21
+
22
+ // Commands
23
+ MessageCommand,
24
+ InteractionCommand,
25
+ ContextMenuCommand,
26
+
27
+ // Events
28
+ Event,
29
+
30
+ // Discord
31
+ Discord,
32
+ functions: Dumfunctions,
33
+
34
+ // Details
35
+ version: pkg.version,
36
36
  }
package/models/Client.js CHANGED
@@ -7,7 +7,7 @@ const { LanguageHandler } = require('./handlers/LanguageHandler.js');
7
7
 
8
8
  /**
9
9
  * @param {string} guildId - Test guild ID.
10
- * @param {boolean} global - Whether the bot shoumd be globally or locally loaded.
10
+ * @param {boolean} global - Whether the bot should be globally or locally loaded.
11
11
  * @param {string[]} prefix - An array of prefix'.
12
12
  * @param {string[]} ownerId - An array of bot owners.
13
13
  * @param {boolean} ignoreOwner - Whether the bot should ignore owner privileges.
@@ -30,7 +30,6 @@ class Client extends Discord.Client {
30
30
  defaultCooldown: s.number.optional,
31
31
  logging: s.boolean.optional,
32
32
  cacheTime: s.number.optional,
33
- dummi: s.boolean.optional,
34
33
  userPermissions: s.array(s.string).optional,
35
34
  clientPermissions: s.array(s.string).optional
36
35
  }).parse(options)
@@ -38,11 +37,11 @@ class Client extends Discord.Client {
38
37
  this.client = new Discord.Client({ intents: [options.intents], partials: [options.partials] });
39
38
 
40
39
  this.client.settings = {
41
- prefix: options.prefix,
40
+ prefix: options.prefix || [],
42
41
 
43
- ownerId: options.ownerId,
42
+ ownerId: options.ownerId || [],
44
43
 
45
- guildId: options.guildId,
44
+ guildId: options.guildId || undefined,
46
45
 
47
46
  global: options.global || false,
48
47
 
@@ -34,7 +34,7 @@ class MessageCommand {
34
34
 
35
35
  this.id = id;
36
36
 
37
- this.aliases = [...(options.aliases ? options.aliases : []), options.name];
37
+ this.aliases = [options.name, ...(options.aliases ? options.aliases : [])];
38
38
 
39
39
  this.type = options.type;
40
40
 
@@ -17,6 +17,8 @@ class BuildInMessageEvent extends Event {
17
17
 
18
18
  async run(message) {
19
19
  if (!message.author.bot) {
20
+ if (message?.client?.settings?.prefix?.length <= 0) return;
21
+
20
22
  await messageUtil(message, "create");
21
23
 
22
24
  for (const prefix of message.client.settings.prefix) {
@@ -16,6 +16,7 @@ class BuildInMessageUpdateEvent extends Event {
16
16
  }
17
17
 
18
18
  async run(oldMessage, newMessage) {
19
+ if (newMessage?.client?.settings?.prefix?.length <= 0) return;
19
20
 
20
21
  await messageUtil(newMessage, "edit");
21
22
 
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
- {
2
- "name": "xernerx",
3
- "version": "2.1.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.0",
23
- "discord.js": "^14.1.2",
24
- "dumfunctions": "^1.0.7",
25
- "i18next": "^21.8.16"
26
- },
27
- "packageManager": "npm@8.5.5"
28
- }
1
+ {
2
+ "name": "xernerx",
3
+ "version": "2.1.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.0",
23
+ "discord.js": "^14.1.2",
24
+ "dumfunctions": "^1.0.7",
25
+ "i18next": "^21.8.16"
26
+ },
27
+ "packageManager": "npm@8.5.5"
28
+ }