JaBa/commands/Owner/reload.js

30 lines
814 B
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js");
class Reload extends Command {
constructor (client) {
super(client, {
name: "reload",
dirname: __dirname,
enabled: true,
guildOnly: false,
aliases: [],
memberPermissions: [],
botPermissions: [],
nsfw: false,
ownerOnly: true,
cooldown: 3000
});
}
async run (message, args) {
const command = args[0];
const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command));
2021-12-11 01:11:50 +05:00
if (!cmd) message.error("owner/reload:NOT_FOUND", { search: command });
2021-12-10 21:39:54 +05:00
await this.client.unloadCommand(cmd.conf.location, cmd.help.name);
await this.client.loadCommand(cmd.conf.location, cmd.help.name);
2021-12-11 01:11:50 +05:00
message.success("owner/reload:SUCCESS", { command: cmd.help.name });
2021-12-10 21:39:54 +05:00
}
2021-12-11 01:11:50 +05:00
};
2021-12-10 21:39:54 +05:00
module.exports = Reload;