From 5ea59a527acd402b547ac305a31c3733a04b8d45 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 20 Jun 2020 09:20:48 -0400 Subject: [PATCH] Fix --- commands/util-public/credit.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/commands/util-public/credit.js b/commands/util-public/credit.js index 3fb32ef5..0e77c751 100644 --- a/commands/util-public/credit.js +++ b/commands/util-public/credit.js @@ -33,15 +33,17 @@ module.exports = class CreditCommand extends Command { }).join('\n')); return msg.embed(embed); } + const cmd = command.toLowerCase(); const commands = this.client.registry.commands - .filter(c => c.credit && c.credit.length && c.credit.find(cred => cred.name.includes(command.toLowerCase()))) - .map(credit => { + .filter(c => c.credit && c.credit.length && c.credit.find(cred => cred.name.toLowerCase().includes(cmd))) + .map(com => { + const { credit } = com; if (!credit.reasonURL) return `${embedURL(credit.name, credit.url)} (${credit.reason})`; return `${embedURL(credit.name, credit.url)} (${embedURL(credit.reason, credit.reasonURL)})`; }); if (!commands.length) return msg.say('Could not find any results.'); const embed = new MessageEmbed() - .setTitle(command.toLowerCase()) + .setTitle(cmd) .setColor(0x7289DA) .setDescription(trimArray(commands, 15).join(', ')); return msg.embed(embed);