better looking help command

This commit is contained in:
SileNce5k 2021-02-14 20:35:06 +01:00
parent a6ce102e05
commit 2aa72c0ea2
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -7,12 +7,12 @@ module.exports = {
name: 'help',
description: 'List all available commands.',
execute(message) {
let str = '';
var commands = ""
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
const embed = new Discord.MessageEmbed()
.setColor(15780145)
.setTitle("Help")
.setTitle("Commands")
.setTimestamp()
.setAuthor("soilens bot", "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
@ -20,10 +20,14 @@ module.exports = {
for (const file of commandFiles) {
const command = require(`./${file}`);
embed.addFields(
{ name: prefix+command.name, value: command.description },
)
console.log(command.name)
var commands = commands + `${prefix}${command.name} | ${command.description}\n`
}
embed.addFields(
{ name: "General",value: commands},
)
message.channel.send(embed);
},