From b66c54550050bcd99aaec7d6424eafe55221f034 Mon Sep 17 00:00:00 2001 From: = Date: Sun, 18 Jul 2021 14:56:45 -0400 Subject: [PATCH] Starting work for new help message --- commands/gif.js | 2 +- commands/help.js | 14 ++++++++++++++ commands/mapcommands.js | 9 +++++++++ config.json | 3 ++- functions.js | 18 ++++++++++++++++++ 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 commands/mapcommands.js diff --git a/commands/gif.js b/commands/gif.js index bfb3410..906c713 100644 --- a/commands/gif.js +++ b/commands/gif.js @@ -1,6 +1,6 @@ const functions = require('../functions'); - const giphy = require('giphy-api')(process.env.giphyAPIKey); + module.exports = { name: 'gif', description: 'Send a GIF', diff --git a/commands/help.js b/commands/help.js index c02ad47..8c3cee9 100644 --- a/commands/help.js +++ b/commands/help.js @@ -6,6 +6,20 @@ module.exports = { const { commands } = message.client; if (!file.name) { + // const helpStructure = { + // commands = [ + // { + // name: commandName, + // aliases: commandAliases, + // description: commandDescription, + // usage: commandUsage, + // cooldown: commandCooldown + // } + // ] + // }; + + + data.push('Here\'s a list of all my commands:'); data.push(commands.map(command => command.name).join(', ')); data.push('\nYou can send `[command name].help` to get info on a specific command!'); diff --git a/commands/mapcommands.js b/commands/mapcommands.js new file mode 100644 index 0000000..4977a8f --- /dev/null +++ b/commands/mapcommands.js @@ -0,0 +1,9 @@ +const functions = require('../functions.js'); + +module.exports = { + name: 'mapcommands', + description: '', + execute(message, file) { + console.log(functions.mapCommands(message.client)); + } +} \ No newline at end of file diff --git a/config.json b/config.json index 60d686a..dc049cf 100644 --- a/config.json +++ b/config.json @@ -20,7 +20,8 @@ "weather", "oldgif", "newgif", - "newpng" + "newpng", + "mapcommands" ], "emoji": { "joint": "<:joint:862082955902976000>", diff --git a/functions.js b/functions.js index a2a38b1..fd35a89 100644 --- a/functions.js +++ b/functions.js @@ -115,5 +115,23 @@ module.exports = { .setTitle() .setTimestamp() .setFooter(`@${author.username}#${author.discriminator}`); + }, + mapCommands(client) { + const { commands } = client; + // return new Promise((resolve, reject) => { + // let commandMap = [] + // for (const [key, value] of commands.map()) { + // // commandMap.push({ + // // name: command.name, + // // aliases: command.aliases, + // // description: command.description, + // // usage: command.usage, + // // cooldown: 0 // Set to 0 for now for the sake of simple code, will add cooldowns later + // // }); + // } + // }); + for (const entry of commands.map(command => [command.name, command.description, command.syntax])) { + console.log(entry); + } } } \ No newline at end of file