Итак, я все еще изучаю JS, и я немного поспрашивал, но пока не получил никаких ответов, но мне интересно, есть ли способ создать команду перезагрузки модуля, чтобы мне не приходилось постоянно перезагружать -node мой бот. Ниже приведена моя текущая команда перезагрузки, с которой я работаю, чтобы хотя бы перезагрузить измененную команду, но я хочу перезагрузить весь модуль, чтобы я мог работать с добавленными командами.
const { MessageEmbed } = require("discord.js");
const eembeds = require(`../../embeds/embeds`);
const config = require(`../../config`);
const Command = require(`../../base/Command`);
class Reload extends Command {
constructor (client) {
super (client, {
name: `reload`,
dirname: __dirname,
enabled: true,
guildOnly: true,
aliases: [`rl`],
memberPermissions: ['SEND_MESSAGES'],
botPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'],
nsfw: false,
cooldown: 15,
ownerOnly: false,
});
}
async run (client, message, args){
await message.delete().catch(() => {});
const command = args[0];
const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command));
if (message.author.id === config.administrators.owner || message.author.id === config.administrators.admin || message.author.id === config.administrators.admin2 || message.author.id === config.administrators.dev || message.author.id === config.administrators.dev2){
if (!cmd) {
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`:warning: Error In: Command :warning:`)
.setColor(0xFFD700)
.setDescription(`Hey <@${message.author.id}>! That command could not be found!`)
.setTimestamp(message.createdAt)
.setFooter(config.copyright);
await message.channel.send(`Hey <@${message.author.id}>!`, embed);
}
else {
//
await this.client.unloadCommand(cmd.conf.location, cmd.help.name);
await this.client.loadCommand(cmd.conf.location, cmd.help.name);
client.logger.log(`Loading Command: ${cmd.help.name}.`, "log");
//
const embed = new MessageEmbed()
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
.setTitle(`Done!`)
.setColor(0xA1EE33)
.setDescription(`Hey <@${message.author.id}>! I have reloaded \`${cmd.help.name}\`!`)
.setTimestamp(message.createdAt)
.setFooter(config.copyright);
await message.channel.send(`Hey <@${message.author.id}>!`, embed);
}
}
else {
await message.channel.send(`Hey <@${message.author.id}>!`, eembeds.UserPermsA);
};
};
};
module.exports = Reload;
Спасибо.





Я понял это, мне просто нужно было использовать мой загрузчик команд, чтобы он работал.