diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-23 21:23:18 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-23 21:23:18 -0500 |
| commit | 3162a4132d36e36635135aefee76ba899694a043 (patch) | |
| tree | 4069282d7070b997166c783411a169c5e2159307 /commands/help.js | |
| parent | bf44f01bc2684fb3ffa7b01f4169a62568164f29 (diff) | |
| download | PokeBot-3162a4132d36e36635135aefee76ba899694a043.tar.gz PokeBot-3162a4132d36e36635135aefee76ba899694a043.tar.bz2 PokeBot-3162a4132d36e36635135aefee76ba899694a043.zip | |
New help
Diffstat (limited to 'commands/help.js')
| -rw-r--r-- | commands/help.js | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/commands/help.js b/commands/help.js index b0fc395..6e97fcd 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,14 +1,31 @@ -exports.run = (bot, msg, args) => { +exports.run = (bot, msg) => { const { RichEmbed } = require('discord.js'); - msg.channel.send( - new RichEmbed() - .setColor (0x00ae86) - .setTitle('PokeBot Command List') - .setDescription('These are the commands you can use. My prefix is `p:`') - .addField('Core', 'help\nping', true) - .addField('Utility', 'suggest', true) - .setFooter('PokeBot Beta') - ); + const embed = new RichEmbed(); + embed + .setColor (0x00ae86) + .setDescription('Notice: When using a command do not include "<" and ">".\n(Example: p:suggest Test)') + .setFooter('PokeBot Beta'); + + const categories = []; + const commands = Array.from(bot.commands.keys()); + + commands.forEach(function(x) { + if (!categories.includes(bot.commands.get(x).help.category)) { + categories.push(bot.commands.get(x).help.category); + } + }); + + categories.forEach(function(x) { + let cat = ''; + commands.forEach(function(command) { + if (bot.commands.get(command).help.category == x) { + const usage = bot.commands.get(command).help.usage ? `*${bot.commands.get(command).help.usage}* ` : ''; + cat += `**p:${command}** ${usage}| ${bot.commands.get(command).help.description} \n`; + } + }); + embed.addField(`${x} |`, cat); + }); + msg.channel.send({ embed }); }; exports.conf = { @@ -18,6 +35,6 @@ exports.conf = { exports.help = { name: 'help', - description: 'Help.', - usage: 'help (command)', + description: 'Displays this help message.', + category: 'Getting Started', }; |
