discord.fixed.js 1.2.2 → 1.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discord.fixed.js",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "An Wrapper for discord developers.",
5
5
  "main": "src/export.js",
6
6
  "scripts": {
package/src/Client/Bot.js CHANGED
@@ -22,12 +22,12 @@ class Bot extends Client {
22
22
 
23
23
  async start(token) {
24
24
  if (this.paths.commands)
25
- require("../loaders/commandLoader")(this);
25
+ require("../Loaders/commandLoader")(this);
26
26
 
27
27
  this.on("messageCreate", this._handleMessage.bind(this));
28
28
 
29
29
  if (this.paths.events)
30
- require("../loaders/eventLoader")(this);
30
+ require("../Loaders/eventLoader")(this);
31
31
 
32
32
  return super.login(token);
33
33
  }
@@ -44,6 +44,10 @@ class Bot extends Client {
44
44
  const name = args.shift().toLowerCase();
45
45
  const command = this.commands.get(name);
46
46
  if (!command) return;
47
+ if (command.ownerOnly && !this.owners.includes(message.author.id)) return message.reply("You are not allowed to use this command.");
48
+ if (command.permissions && !message.member.permissions.has(command.permissions)) return message.reply("You do not have the required permissions to use this command.");
49
+ if (command.botPermissions && !message.guild.members.me.permissions.has(command.botPermissions)) return message.reply("I do not have the required permissions to execute this command.");
50
+ if (command.working === false || command.disabled === true || command.maintanance === true) return message.reply("This command is currently disabled due to some issues.");
47
51
 
48
52
  try {
49
53
  command.execute(this, message, args);