diff --git a/src/structures/BotClient.js b/src/structures/BotClient.js index 5cec62ebf..907febc0b 100644 --- a/src/structures/BotClient.js +++ b/src/structures/BotClient.js @@ -175,6 +175,7 @@ module.exports = class BotClient extends Client { const files = recursiveReadDirSync(directory); for (const file of files) { try { + delete require.cache[require.resolve(file)]; const cmd = require(file); if (typeof cmd !== "object") continue; validateCommand(cmd); @@ -198,6 +199,7 @@ module.exports = class BotClient extends Client { const files = recursiveReadDirSync(directory); for (const file of files) { try { + delete require.cache[require.resolve(file)]; const ctx = require(file); if (typeof ctx !== "object") continue; validateContext(ctx);