aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorUnknown <jtsshieh@outlook.com>2018-03-10 23:12:40 -0400
committerUnknown <jtsshieh@outlook.com>2018-03-10 23:12:40 -0400
commite9ed8e2427dcb15a2de0e8b9f65f698df750bbc3 (patch)
tree4f194cbd3012863a957a881aa12a0f2312e1f36a /commands
parentcf1cbc5b71ec19d8c1508fdb467384613c6ae50e (diff)
downloadPokeBot-e9ed8e2427dcb15a2de0e8b9f65f698df750bbc3.tar.gz
PokeBot-e9ed8e2427dcb15a2de0e8b9f65f698df750bbc3.tar.bz2
PokeBot-e9ed8e2427dcb15a2de0e8b9f65f698df750bbc3.zip
testing my luck again
Diffstat (limited to 'commands')
-rw-r--r--commands/Getting Started/help.js58
1 files changed, 41 insertions, 17 deletions
diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js
index c44424c..fe64a19 100644
--- a/commands/Getting Started/help.js
+++ b/commands/Getting Started/help.js
@@ -18,26 +18,50 @@
*
* *************************************/
-exports.run = (bot, msg) => {
+exports.run = (bot, msg, args) => {
const { RichEmbed } = require('discord.js');
- 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');
+ if (!args[0]) {
+ 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 = Array.from(bot.categories.keys());
- categories.forEach(x => {
- let cat = '';
- const commands = bot.categories.get(x);
- commands.forEach(cmd => {
- const command = bot.commands.get(x).get(cmd);
- const usage = command.help.usage ? `*${command.help.usage}* ` : '';
- cat += `**p:${command.help.name}** ${usage}| ${command.help.description} \n`;
+ const categories = Array.from(bot.categories.keys());
+ categories.forEach(x => {
+ let cat = '';
+ const commands = bot.categories.get(x);
+ commands.forEach(cmd => {
+ const command = bot.commands.get(x).get(cmd);
+ cat += `**${command.help.name}**\n`;
+ });
+ embed.addField(x, cat);
});
- embed.addField(`${x} |`, cat);
- });
- msg.channel.send({ embed });
+ msg.channel.send({ embed });
+ }
+ else {
+ 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 = Array.from(bot.categories.keys());
+ categories.forEach(x => {
+ const commands = bot.categories.get(x);
+ commands.forEach(cmd => {
+ const command = bot.commands.get(x).get(cmd);
+ if (command.help.name == args[1]) {
+ const usage = command.help.usage ? `*${command.help.usage}* ` : '*none*';
+ embed.addField('Name', command.help.name, true);
+ embed.addField('Description', command.help.description, true);
+ embed.addField('Usage', usage, true);
+ embed.addField('Aliases', command.conf.aliases, true);
+ msg.channel.send({ embed });
+ }
+ });
+ });
+ }
};
exports.conf = {