Fix gen-credit for real

This commit is contained in:
Dragon Fire
2020-04-12 09:41:52 -04:00
parent d8772f40d9
commit 57b78965a2
+2 -2
View File
@@ -44,8 +44,8 @@ module.exports = class GenerateCreditCommand extends Command {
credit = sortByName(credit, 'name');
const mapped = credit
.map(c => `- ${embedURL(c.name, c.url || '')}\n${sortByName(c.commands, 'name').map(cmd => {
if (!cmd.reasonURL) return ` * ${cmd.name} (${cmd.reason})`;
return ` * ${cmd.name} (${embedURL(c.reason, c.reasonURL || '')})`;
if (!cmd.credit.reasonURL) return ` * ${cmd.credit.name} (${cmd.credit.reason})`;
return ` * ${cmd.credit.name} (${embedURL(c.credit.reason, c.credit.reasonURL || '')})`;
}).join('\n')}`);
return msg.channel.send({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] });
}