From c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 14:59:35 -0500 Subject: New Command system --- commands/Getting Started/help.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/Getting Started/help.js (limited to 'commands/Getting Started/help.js') diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js new file mode 100644 index 0000000..13ac206 --- /dev/null +++ b/commands/Getting Started/help.js @@ -0,0 +1,31 @@ +exports.run = (bot, msg) => { + 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'); + + 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`; + }); + embed.addField(`${x} |`, cat); + }); + msg.channel.send({ embed }); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'help', + description: 'Displays this help message.', +}; -- cgit v1.2.3