mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user