xernerx 2.1.1 → 2.1.4

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
@@ -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
@@ -34,14 +34,14 @@ class Client extends Discord.Client {
34
34
  clientPermissions: s.array(s.string).optional
35
35
  }).parse(options)
36
36
 
37
- this.client = new Discord.Client({ intents: [options.intents], partials: [options.partials] });
37
+ this.client = new Discord.Client({ intents: [options.intents || 0], partials: [options.partials] });
38
38
 
39
39
  this.client.settings = {
40
- prefix: options.prefix,
40
+ prefix: options.prefix || [],
41
41
 
42
- ownerId: options.ownerId,
42
+ ownerId: options.ownerId || [],
43
43
 
44
- guildId: options.guildId,
44
+ guildId: options.guildId || undefined,
45
45
 
46
46
  global: options.global || false,
47
47
 
@@ -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.1",
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.4",
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
+ }