From ca77b63c97f759bac522da0f146e4a01d0b32cfb Mon Sep 17 00:00:00 2001 From: IDeletedSystem64 Date: Tue, 26 Jul 2022 23:27:46 -0500 Subject: [PATCH] Fuck it. This only fixes the crashes on startup, Does NOT work with slash commands. --- commands/help.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/commands/help.js b/commands/help.js index 77e7377..4918e95 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,26 +1,30 @@ +const { Constants } = require('discord.js'); + module.exports = { name: require('path').parse(__filename).name, description: 'Get help on anything from commands, to what the bot does! just not your homework..', options: [{ - name: '', + name: 'command', description: 'View Information about this command', - required: false + required: false, + type: Constants.ApplicationCommandOptionTypes.STRING }], async parseMessage (client, config, message, args) { - await message.channel.send(this.handle(client, config, message.author, args)); + await message.channel.send(this.handle(client, config, message.author, args[0])); }, async parseInteraction (client, config, interaction) { - await interaction.reply(this.handle(client, config, interaction.user)); + await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('command'))); }, - handle (client, config, user, args) { - if (!args[0]) { + handle (client, config, user, command) { + if (!command) { return client.generateErrorMessage('Note to self: Design default help embed.', user.displayAvatarURL()); } - const cmdName = args[0].toLowerCase(); + // const cmdName = args[0].toLowerCase(); + const cmdName = command const cmd = client.commands.get(cmdName); if (!cmd) {