2022-07-26 23:27:46 -05:00
|
|
|
const { Constants } = require('discord.js');
|
|
|
|
|
2021-01-19 14:02:09 -06:00
|
|
|
module.exports = {
|
2022-04-21 18:09:21 -05:00
|
|
|
|
2022-04-18 11:25:40 -05:00
|
|
|
name: require('path').parse(__filename).name,
|
2022-03-18 21:27:09 -05:00
|
|
|
description: 'Get help on anything from commands, to what the bot does! just not your homework..',
|
2022-07-26 20:44:00 -05:00
|
|
|
options: [{
|
2022-08-02 23:53:44 -05:00
|
|
|
name: 'help',
|
2022-08-11 16:38:30 -05:00
|
|
|
description: 'The command you want information on',
|
2022-07-26 23:27:46 -05:00
|
|
|
required: false,
|
|
|
|
type: Constants.ApplicationCommandOptionTypes.STRING
|
2022-07-26 20:44:00 -05:00
|
|
|
}],
|
2022-04-21 23:44:02 -05:00
|
|
|
|
|
|
|
async parseInteraction (client, config, interaction) {
|
2022-08-02 23:53:44 -05:00
|
|
|
await interaction.reply(this.handle(client, config, interaction.user, interaction.options.getString('help')));
|
2022-04-21 23:44:02 -05:00
|
|
|
},
|
|
|
|
|
2022-07-26 23:27:46 -05:00
|
|
|
handle (client, config, user, command) {
|
|
|
|
if (!command) {
|
2022-08-02 23:53:44 -05:00
|
|
|
return {
|
|
|
|
embeds: [{
|
2022-08-10 22:27:17 -05:00
|
|
|
color: 9442302,
|
2022-08-02 23:53:44 -05:00
|
|
|
title: `:question: SEYMOUR! THE ${client.user.username} IS ON FIRE!`,
|
|
|
|
description: `Run ${config.prefix}help for more information on each command.`,
|
|
|
|
footer: {
|
|
|
|
icon_url: user.displayAvatarURL(),
|
|
|
|
text: config.footerTxt
|
|
|
|
},
|
|
|
|
fields: [
|
2022-08-11 16:38:30 -05:00
|
|
|
{ name: 'Commands', value: client.commands.map(command => command.name).join(', ') }
|
2022-08-02 23:53:44 -05:00
|
|
|
]
|
|
|
|
}]
|
|
|
|
};
|
2022-07-26 20:44:00 -05:00
|
|
|
}
|
|
|
|
|
2022-08-02 23:53:44 -05:00
|
|
|
const cmdName = command;
|
2022-07-26 20:44:00 -05:00
|
|
|
const cmd = client.commands.get(cmdName);
|
2022-08-10 22:27:17 -05:00
|
|
|
console.log(cmd.options.map);
|
2022-07-26 20:44:00 -05:00
|
|
|
if (!cmd) {
|
2022-08-10 22:27:17 -05:00
|
|
|
return client.generateErrorMessage(`${cmdName} is not a valid command. Run ${config.prefix}help for a command list!`);
|
2022-07-26 20:44:00 -05:00
|
|
|
}
|
2022-04-21 23:44:02 -05:00
|
|
|
return {
|
2022-04-21 18:09:21 -05:00
|
|
|
embeds: [{
|
|
|
|
color: 9442302,
|
2022-07-26 20:44:00 -05:00
|
|
|
title: ':question: Command Help',
|
|
|
|
description: `Everything you've ever wanted to know about ${cmdName}!`,
|
2022-04-21 18:09:21 -05:00
|
|
|
footer: {
|
2022-04-21 23:44:02 -05:00
|
|
|
icon_url: user.displayAvatarURL(),
|
2022-07-26 20:44:00 -05:00
|
|
|
text: config.footerTxt
|
2022-03-18 21:27:09 -05:00
|
|
|
},
|
2022-04-21 18:09:21 -05:00
|
|
|
fields: [
|
2022-07-26 20:44:00 -05:00
|
|
|
{ name: 'Command Name', value: `${cmdName}`, inline: true },
|
|
|
|
{ name: 'Command Description', value: cmd.description, inline: true },
|
|
|
|
{ name: 'Command Options', value: cmd.options.map(option => option.name).join('\n') || 'None', inline: true },
|
2022-08-10 22:27:17 -05:00
|
|
|
{ name: 'Command Option Description', value: cmd.options.map(option => option.description).join('\n') || 'None', inline: true }
|
|
|
|
// { name: 'Command Option Required?', value: cmd.options.map(option => option.required) ? 'Yes' : 'No' }
|
2022-04-21 18:09:21 -05:00
|
|
|
]
|
|
|
|
}]
|
2022-04-21 23:44:02 -05:00
|
|
|
};
|
2022-03-26 03:33:18 -05:00
|
|
|
}
|
2022-04-21 18:09:21 -05:00
|
|
|
};
|