functions do be like that
This commit is contained in:
parent
84250f1f32
commit
fa95c1101c
|
@ -113,8 +113,8 @@ module.exports = (client) => {
|
||||||
if (command.shutdown) {
|
if (command.shutdown) {
|
||||||
await command.shutdown(client);
|
await command.shutdown(client);
|
||||||
}
|
}
|
||||||
const mod = require.cache[require.resolve(`../commands/${command.help.category}/${command.help.name}`)];
|
const mod = require.cache[require.resolve(`../commands/${command.help.category}/${commandName}.js`)];
|
||||||
delete require.cache[require.resolve(`../commands/${command.help.category}/${command.help.name}.js`)];
|
delete require.cache[require.resolve(`../commands/${command.help.category}/${commandName}.js`)];
|
||||||
for (let i = 0; i < mod.parent.children.length; i++) {
|
for (let i = 0; i < mod.parent.children.length; i++) {
|
||||||
if (mod.parent.children[i] === mod) {
|
if (mod.parent.children[i] === mod) {
|
||||||
mod.parent.children.splice(i, 1);
|
mod.parent.children.splice(i, 1);
|
||||||
|
@ -125,8 +125,7 @@ module.exports = (client) => {
|
||||||
|
|
||||||
// step 2: load said command
|
// step 2: load said command
|
||||||
try {
|
try {
|
||||||
client.logger.log(`Loading Command: ${commandName}`);
|
const props = require(`../commands/${command.help.category}/${command.Name}`);
|
||||||
const props = require(`../${commandName}`);
|
|
||||||
if (props.init) {
|
if (props.init) {
|
||||||
props.init(client);
|
props.init(client);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue