diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/help.js | 41 | ||||
| -rw-r--r-- | commands/ping.js | 6 | ||||
| -rw-r--r-- | commands/suggest.js | 5 |
3 files changed, 35 insertions, 17 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', }; diff --git a/commands/ping.js b/commands/ping.js index 8ba3ae9..0c61fd5 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -1,4 +1,4 @@ -exports.run = (bot, msg, args) => { +exports.run = (bot, msg) => { msg.channel.send(':ping_pong: Pong! ' + Math.floor(bot.ping) + 'ms.'); }; @@ -9,6 +9,6 @@ exports.conf = { exports.help = { name: 'ping', - description: 'ping.', - usage: 'ping', + description: 'Pings the bot and replies with the latency.', + category:'Getting Started', }; diff --git a/commands/suggest.js b/commands/suggest.js index 976d524..1332fde 100644 --- a/commands/suggest.js +++ b/commands/suggest.js @@ -19,6 +19,7 @@ exports.conf = { exports.help = { name: 'suggest', - description: 'Suggest a feature.', - usage: 'suggest <...Suggestion>', + description: 'Suggest a feature for the bot or the server.', + usage: '<...suggestion>', + category: 'Utility', }; |
