This commit is contained in:
Dragon Fire
2020-06-20 09:20:48 -04:00
parent 30d79e2522
commit 5ea59a527a
+5 -3
View File
@@ -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);