Help command

This commit is contained in:
Wizzard 2024-08-17 15:20:51 -04:00
parent 2836e859f5
commit 22dcc9b7bf
2 changed files with 45 additions and 0 deletions

44
commands/help.js Normal file
View File

@ -0,0 +1,44 @@
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: 'help',
description: 'List all commands or get details about a specific command.',
execute(message, args) {
const { commands } = message.client;
const commandsArray = Array.from(commands.values());
if (!args.length) {
const embed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle('Help - List of Commands')
.setDescription('Here\'s a list of all my commands:')
.addFields(
commandsArray.map(command => ({
name: `\`${command.name}\``,
value: command.description || 'No description provided',
inline: true,
}))
)
.setFooter({ text: 'You can send `+help [command name]` to get info on a specific command!' });
return message.channel.send({ embeds: [embed] });
}
const name = args[0].toLowerCase();
const command = commands.get(name);
if (!command) {
return message.reply('That\'s not a valid command!');
}
const embed = new EmbedBuilder()
.setColor('#0099ff')
.setTitle(`Help - \`${command.name}\``)
.addFields(
{ name: 'Name', value: command.name, inline: true },
{ name: 'Description', value: command.description || 'No description provided', inline: true }
);
message.channel.send({ embeds: [embed] });
},
};

View File

@ -2,6 +2,7 @@ const { skipTrack } = require('../utils/queueManager');
module.exports = { module.exports = {
name: 'skip', name: 'skip',
description: 'Skip the current track',
execute(message) { execute(message) {
const guildId = message.guild.id; const guildId = message.guild.id;
const voiceChannel = message.member.voice.channel; const voiceChannel = message.member.voice.channel;