From 3ddd8b8d2568f083111af52c6d2914257dca38dc Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 19 Mar 2020 16:26:24 +0100 Subject: [PATCH] If there is an image example, use it --- commands/utility/help.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commands/utility/help.js b/commands/utility/help.js index ebef98d0..1399213b 100644 --- a/commands/utility/help.js +++ b/commands/utility/help.js @@ -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 }); }