diff options
| author | Unknown <jtsshieh@outlook.com> | 2018-02-24 14:59:35 -0500 |
|---|---|---|
| committer | Unknown <jtsshieh@outlook.com> | 2018-02-24 14:59:35 -0500 |
| commit | c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e (patch) | |
| tree | 93fd74f30abbd3c8206321b9d9c20b2571ed84ca /commands | |
| parent | 3d36bcf0591f2694c3a2472a157ecca0de8d35fc (diff) | |
| download | PokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.tar.gz PokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.tar.bz2 PokeBot-c484753ee15dbe2a5ce9c6297f22fabb52ce3b7e.zip | |
New Command system
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/Fun/8ball.js (renamed from commands/8ball.js) | 1 | ||||
| -rw-r--r-- | commands/Fun/cureboredom.js (renamed from commands/cureboredom.js) | 1 | ||||
| -rw-r--r-- | commands/Fun/og151.js (renamed from commands/og151.js) | 1 | ||||
| -rw-r--r-- | commands/Fun/ship.js (renamed from commands/ship.js) | 1 | ||||
| -rw-r--r-- | commands/Fun/story.js (renamed from commands/story.js) | 1 | ||||
| -rw-r--r-- | commands/Getting Started/help.js | 31 | ||||
| -rw-r--r-- | commands/Information/contribute.js (renamed from commands/contribute.js) | 1 | ||||
| -rw-r--r-- | commands/Information/ping.js (renamed from commands/ping.js) | 1 | ||||
| -rw-r--r-- | commands/Moderation/ban.js (renamed from commands/ban.js) | 1 | ||||
| -rw-r--r-- | commands/Moderation/kick.js (renamed from commands/kick.js) | 1 | ||||
| -rw-r--r-- | commands/Moderation/purge.js (renamed from commands/purge.js) | 1 | ||||
| -rw-r--r-- | commands/Moderation/softban.js (renamed from commands/softban.js) | 1 | ||||
| -rw-r--r-- | commands/Moderation/warn.js (renamed from commands/warn.js) | 1 | ||||
| -rw-r--r-- | commands/Owners Only/poweroff.js (renamed from commands/poweroff.js) | 1 | ||||
| -rw-r--r-- | commands/Owners Only/say.js (renamed from commands/say.js) | 1 | ||||
| -rw-r--r-- | commands/Teams/join.js (renamed from commands/join.js) | 1 | ||||
| -rw-r--r-- | commands/Teams/leave.js (renamed from commands/leave.js) | 1 | ||||
| -rw-r--r-- | commands/Utility/suggest.js (renamed from commands/suggest.js) | 1 | ||||
| -rw-r--r-- | commands/Utility/uptime.js (renamed from commands/uptime.js) | 1 | ||||
| -rw-r--r-- | commands/help.js | 40 |
20 files changed, 31 insertions, 58 deletions
diff --git a/commands/8ball.js b/commands/Fun/8ball.js index f188270..3ebd1c3 100644 --- a/commands/8ball.js +++ b/commands/Fun/8ball.js @@ -44,5 +44,4 @@ exports.help = { name: '8ball', description: 'Ask the magic 8-ball something. It will answer back, and be as much of a smart-alac as it wants to.', usage: '<...question>', - category: 'Fun', }; diff --git a/commands/cureboredom.js b/commands/Fun/cureboredom.js index e011c80..9996645 100644 --- a/commands/cureboredom.js +++ b/commands/Fun/cureboredom.js @@ -20,5 +20,4 @@ exports.conf = { exports.help = { name: 'cureboredom', description: 'Finds you something to do.', - category: 'Fun', }; diff --git a/commands/og151.js b/commands/Fun/og151.js index fd7f3e5..bda9059 100644 --- a/commands/og151.js +++ b/commands/Fun/og151.js @@ -164,5 +164,4 @@ exports.conf = { exports.help = { name: 'og151', description: 'Randomly picks one of the generation 1 pokemon, and gives you its name.', - category: 'Fun', }; diff --git a/commands/ship.js b/commands/Fun/ship.js index 8282bf3..ed8cf69 100644 --- a/commands/ship.js +++ b/commands/Fun/ship.js @@ -10,5 +10,4 @@ exports.conf = { exports.help = { name: 'ship', description: 'Test the luck of your love life! Ships you with another user.', - category: 'Fun', }; diff --git a/commands/story.js b/commands/Fun/story.js index 85e535e..037b7cb 100644 --- a/commands/story.js +++ b/commands/Fun/story.js @@ -24,5 +24,4 @@ exports.conf = { exports.help = { name: 'story', description: 'Tells you a story.', - category: 'Fun', }; 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.', +}; diff --git a/commands/contribute.js b/commands/Information/contribute.js index b6a2d6f..6a578fe 100644 --- a/commands/contribute.js +++ b/commands/Information/contribute.js @@ -10,5 +10,4 @@ exports.conf = { exports.help = { name: 'contribute', description: 'Contributing to the bot.', - category: 'Information', }; diff --git a/commands/ping.js b/commands/Information/ping.js index d1d9204..f4e50e4 100644 --- a/commands/ping.js +++ b/commands/Information/ping.js @@ -10,5 +10,4 @@ exports.conf = { exports.help = { name: 'ping', description: 'Pings the bot and replies with the latency.', - category:'Information', }; diff --git a/commands/ban.js b/commands/Moderation/ban.js index 902b4fd..3582bc3 100644 --- a/commands/ban.js +++ b/commands/Moderation/ban.js @@ -37,5 +37,4 @@ exports.help = { name: 'ban', description: 'Ban a user from this server.', usage: '@user <...reason>', - category: 'Moderation', }; diff --git a/commands/kick.js b/commands/Moderation/kick.js index b015d01..040abb5 100644 --- a/commands/kick.js +++ b/commands/Moderation/kick.js @@ -20,5 +20,4 @@ exports.help = { name: 'kick', description: 'Kick a user out of the server.', usage: '@user <...reason>', - category: 'Moderation', }; diff --git a/commands/purge.js b/commands/Moderation/purge.js index f02cb0a..0540bb3 100644 --- a/commands/purge.js +++ b/commands/Moderation/purge.js @@ -27,5 +27,4 @@ exports.help = { name: 'purge', description: 'Get rid of messages quickly.', usage: '@user <messages>', - category:'Moderation', }; diff --git a/commands/softban.js b/commands/Moderation/softban.js index 3044090..f95e3b8 100644 --- a/commands/softban.js +++ b/commands/Moderation/softban.js @@ -37,5 +37,4 @@ exports.help = { name: 'softban', description: 'Kick the user and delete their messages.', usage: '@user <...reason>', - category: 'Moderation', }; diff --git a/commands/warn.js b/commands/Moderation/warn.js index 88305a0..75d586c 100644 --- a/commands/warn.js +++ b/commands/Moderation/warn.js @@ -29,5 +29,4 @@ exports.help = { name: 'warn', description: 'Logs a warning to the user.', usage : '@user <reason>', - category: 'Moderation', }; diff --git a/commands/poweroff.js b/commands/Owners Only/poweroff.js index ae2ec67..ddd0c56 100644 --- a/commands/poweroff.js +++ b/commands/Owners Only/poweroff.js @@ -17,5 +17,4 @@ exports.conf = { exports.help = { name: 'poweroff', description: 'Powers off the bot.', - category: 'Owners Only', }; diff --git a/commands/say.js b/commands/Owners Only/say.js index 1d57a06..0f8a6df 100644 --- a/commands/say.js +++ b/commands/Owners Only/say.js @@ -17,5 +17,4 @@ exports.help = { name: 'say', description: 'Control on what the bot says.', usage: '<...text>', - category: 'Owners Only', }; diff --git a/commands/join.js b/commands/Teams/join.js index dc3ba84..c9ba26e 100644 --- a/commands/join.js +++ b/commands/Teams/join.js @@ -57,5 +57,4 @@ exports.help = { name: 'join', description: 'Join one of the teams!', usage: '<mystic/valor/instinct>', - category: 'Teams', }; diff --git a/commands/leave.js b/commands/Teams/leave.js index 850d7ce..c22a1f2 100644 --- a/commands/leave.js +++ b/commands/Teams/leave.js @@ -24,5 +24,4 @@ exports.conf = { exports.help = { name: 'leave', description: 'Leave the team you currently are in.', - category: 'Teams', }; diff --git a/commands/suggest.js b/commands/Utility/suggest.js index 1332fde..831d222 100644 --- a/commands/suggest.js +++ b/commands/Utility/suggest.js @@ -21,5 +21,4 @@ exports.help = { name: 'suggest', description: 'Suggest a feature for the bot or the server.', usage: '<...suggestion>', - category: 'Utility', }; diff --git a/commands/uptime.js b/commands/Utility/uptime.js index 3c2f177..63bd6a4 100644 --- a/commands/uptime.js +++ b/commands/Utility/uptime.js @@ -21,5 +21,4 @@ exports.conf = { exports.help = { name: 'uptime', description: 'Get the uptime of the bot.', - category: 'Utility', }; diff --git a/commands/help.js b/commands/help.js deleted file mode 100644 index 6e97fcd..0000000 --- a/commands/help.js +++ /dev/null @@ -1,40 +0,0 @@ -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 = []; - 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 = { - aliases: [], - guildOnly: true, -}; - -exports.help = { - name: 'help', - description: 'Displays this help message.', - category: 'Getting Started', -}; |
