This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
legacy-musicbot/commands/core/help.js
2020-12-21 23:52:02 +01:00

48 lines
2.6 KiB
JavaScript

module.exports = {
name: 'help',
aliases: ['h'],
category: 'Core',
utilisation: '{prefix}help <command name>',
execute(client, message, args) {
if (!args[0]) {
const infos = message.client.commands.filter(c => c.category == 'Infos').map((c) => '`' + c.name + '`').join(', ');
const music = message.client.commands.filter(c => c.category == 'Music').map((c) => '`' + c.name + '`').join(', ');
message.channel.send({
embed: {
color: 'ORANGE',
author: { name: 'Help pannel' },
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Bot', value: infos },
{ name: 'Music', value: music },
{ name: 'Filters', value: '`bassboost`, `8D`, `vaporwave`, `nightcore`, `phaser`, `tremolo`, `vibrato`, `reverse`, `treble`, `normalizer`, `surrounding`, `pulsator`, `subboost`, `karaoke`, `flanger`, `gate`, `haas`, `mcompand`' },
],
timestamp: new Date(),
description: `To use filters, ${client.config.discord.prefix}filter (the filter). Example : ${client.config.discord.prefix}filter 8D.`,
},
});
} else {
const command = message.client.commands.get(args.join(" ").toLowerCase()) || message.client.commands.find(c => c.aliases && c.aliases.includes(args.join(" ").toLowerCase()));
if (!command) return message.channel.send(`${client.emotes.error} - I did not find this command !`);
message.channel.send({
embed: {
color: 'ORANGE',
author: { name: 'Help pannel' },
footer: { text: 'This bot uses a Github project made by Zerio (ZerioDev/Music-bot)' },
fields: [
{ name: 'Name', value: command.name, inline: true },
{ name: 'Category', value: command.category, inline: true },
{ name: 'Aliase(s)', value: command.aliases.length < 1 ? 'None' : command.aliases.join('\n'), inline: true },
{ name: 'Utilisation', value: command.utilisation.replace('{prefix}', client.config.discord.prefix), inline: true },
],
timestamp: new Date(),
description: 'Find information on the command provided.\nMandatory arguments `[]`, optional arguments `<>`.',
}
});
};
},
};