diff --git a/commands/help.js b/commands/help.js index 75d36c7..3d35711 100644 --- a/commands/help.js +++ b/commands/help.js @@ -25,7 +25,7 @@ module.exports = { .setTimestamp() .setAuthor("soilens bot", "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048") - + let noHelp = 0; for (const file of commandFiles) { const command = require(`./${file}`); @@ -33,15 +33,30 @@ module.exports = { if (args[0] == "admin") { if (command.admin && !command.disabled) commands = commands + `${prefix}${command.name} | ${command.description}\n` - } else + }else if(!args[0]){ if (!command.admin && !command.disabled) commands = commands + `${prefix}${command.name} | ${command.description}\n` + }else if(args[0] === command.name){ + commands = commands + `${prefix}${command.name}\n` + if(command.moreHelp){ + command.moreHelp.forEach(element => { + commands = commands + `${element}\n` + }); + } else { + noHelp = 1; + } + break; + } } + let regex = //g + commands = commands.replace(regex, prefix) embed.addFields( { name: "General", value: commands }, ) - - message.channel.send(embed); + if(noHelp == 0) + message.channel.send(embed); + else + message.channel.send("Either there is no command with that name, or there is no specific help for it.") }, }; diff --git a/commands/userinfo.js b/commands/userinfo.js index 7a9b46d..66949dd 100644 --- a/commands/userinfo.js +++ b/commands/userinfo.js @@ -5,6 +5,7 @@ const creationJoinDates = require("../util/creationJoinDates") module.exports = { name: 'userinfo', description: 'Displays information about the user', + moreHelp: ["Example: userinfo ","It works with username, nickname, userid, and mention"], execute({message, args}) { let info; let nickname = "";