From 908526eda98336bef7ea22d82e4c0aa92a31b5ef Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 25 Mar 2022 00:00:02 +0100 Subject: [PATCH] Final help fix... --- commands/info/help.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/commands/info/help.js b/commands/info/help.js index a5c88f4..3b1dd16 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -15,6 +15,7 @@ module.exports = { let commands = "" let commandFiles = getSubdirFiles('commands/') let x = 0 + let fieldName = "General"; if (args[0] == "netmodules") { commandFiles = fs.readdirSync('../../netload').filter(file => file.endsWith('.js')); if (commandFiles.length == 0) { @@ -31,7 +32,6 @@ module.exports = { .setTimestamp() .setAuthor(client.user.username, client.user.avatarURL({ dynamic: true, size: 4096 })) - let noHelp = 0; for (const file of commandFiles) { const command = require(`../../${file}`); if(command.disabled) continue; @@ -50,22 +50,17 @@ module.exports = { commands = commands + `${element}\n` }); } else { - commands = commands + `Description:\n${command.description}\n`; + fieldName = "Description"; + commands = commands + `${command.description}`; } break; } } - let regex = //g - if(commands === ""){ - noHelp = 1; - } + let regex = //g; commands = commands.replace(regex, prefix) embed.addFields( - { name: "General", value: commands }, + { name: fieldName, value: commands }, ) - if(noHelp == 0) message.channel.send({embeds :[embed]}); - else - message.channel.send("Either there is no command with that name, or there is no specific help for it.") }, }; \ No newline at end of file