Help command
This commit is contained in:
parent
2836e859f5
commit
22dcc9b7bf
|
@ -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] });
|
||||
},
|
||||
};
|
|
@ -2,6 +2,7 @@ const { skipTrack } = require('../utils/queueManager');
|
|||
|
||||
module.exports = {
|
||||
name: 'skip',
|
||||
description: 'Skip the current track',
|
||||
execute(message) {
|
||||
const guildId = message.guild.id;
|
||||
const voiceChannel = message.member.voice.channel;
|
||||
|
|
Loading…
Reference in New Issue