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);