From a055995b7388c1af829596eb628574f917aae9e6 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Mar 2022 23:32:43 +0100 Subject: [PATCH 1/5] Revert "Fix help on specific commands" This reverts commit 72a6d7800390685ea8471faa14ab5f4e036cfb97. --- commands/info/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/info/help.js b/commands/info/help.js index 611115a..de82c05 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -50,7 +50,7 @@ module.exports = { commands = commands + `${element}\n` }); } else { - commands = command.description; + //commands = command.description; noHelp = 1; } break; From 4cba23dbe297c3a89ae523dd5869ce27e22226a9 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Mar 2022 23:33:30 +0100 Subject: [PATCH 2/5] Revert "If no moreHelp is available..." This reverts commit bcff645ba7cd4738e12245fefcdac41dac9802eb. --- commands/info/help.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/commands/info/help.js b/commands/info/help.js index de82c05..8f3ef3c 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -50,29 +50,22 @@ module.exports = { commands = commands + `${element}\n` }); } else { - //commands = command.description; noHelp = 1; } break; } } let regex = //g + if(commands === ""){ + noHelp = 1; + } commands = commands.replace(regex, prefix) embed.addFields( { name: " ", value: commands }, ) - if(commands === false){ - message.channel.send("There is no command with that name"); - } - else if(noHelp == 0){ + if(noHelp == 0) message.channel.send({embeds :[embed]}); - } - else { - /*embed.addFields( - {name: "Help", value: commands} - )*/ - 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 From cbb0cc03d8119e4e1dc66faaf8431c58a37220f0 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Mar 2022 23:46:08 +0100 Subject: [PATCH 3/5] Attempt #2 to fix help command --- commands/info/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/info/help.js b/commands/info/help.js index 8f3ef3c..b1db9da 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -50,7 +50,7 @@ module.exports = { commands = commands + `${element}\n` }); } else { - noHelp = 1; + commands = commands + `Description:\n${command.description}\n`; } break; } From 56df5dcea3166a1d9f62549c362a3562071a8798 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 24 Mar 2022 23:47:47 +0100 Subject: [PATCH 4/5] Revert "Testing thing" This reverts commit 921eb318bcb46b366ca569804b458741266dcdcd. --- commands/info/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/info/help.js b/commands/info/help.js index b1db9da..a5c88f4 100644 --- a/commands/info/help.js +++ b/commands/info/help.js @@ -61,7 +61,7 @@ module.exports = { } commands = commands.replace(regex, prefix) embed.addFields( - { name: " ", value: commands }, + { name: "General", value: commands }, ) if(noHelp == 0) message.channel.send({embeds :[embed]}); From 908526eda98336bef7ea22d82e4c0aa92a31b5ef Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Fri, 25 Mar 2022 00:00:02 +0100 Subject: [PATCH 5/5] 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