If there is an image example, use it

This commit is contained in:
loicbersier 2020-03-19 16:26:24 +01:00
parent eaf3b91239
commit 3ddd8b8d25

View file

@ -1,4 +1,5 @@
const { Command } = require('discord-akairo');
const fs = require('fs');
class HelpCommand extends Command {
constructor() {
@ -61,6 +62,11 @@ class HelpCommand extends Command {
embed.addField('Bot permission', `\`${command.clientPermissions.join('` `')}\``, true);
}
if (fs.existsSync(`./asset/img/command/${command.category.id}/${command.id}.png`)) {
embed.attachFiles(`./asset/img/command/${command.category.id}/${command.id}.png`);
embed.setImage(`attachment://${command.id}.png`);
}
return message.util.send({ embed });
}