From c0df5e0367135c6b3075dc0da2ff05054e3144e4 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 22 Nov 2019 12:55:56 +0100 Subject: [PATCH] Make the unloaded command unique so multiples command can be disabled --- commands/owner/unload.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/commands/owner/unload.js b/commands/owner/unload.js index b6ba9d1..47492c8 100644 --- a/commands/owner/unload.js +++ b/commands/owner/unload.js @@ -29,7 +29,7 @@ class unloadCommand extends Command { async exec(message, args) { this.handler.remove(args.command); if (!args.noplaceholder) { - fs.writeFile('./unloaded.js', `const { Command } = require('discord-akairo'); + fs.writeFile(`./${args.command}_unloaded.js`, `const { Command } = require('discord-akairo'); class ${args.command}Command extends Command { constructor() { @@ -49,8 +49,7 @@ class unloadCommand extends Command { } module.exports = ${args.command}Command;`,() => { - this.handler.load(`${__dirname}/../../unloaded.js`); - + this.handler.load(`${__dirname}/../../${args.command}_unloaded.js`); }); } return message.channel.send(`Sucessfully unloaded command ${args.command}`);