Display links in all embed URLs

This commit is contained in:
Dragon Fire
2020-03-28 21:57:02 -04:00
parent 3ce12b79cd
commit 1c272e3307
17 changed files with 44 additions and 36 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
const Command = require('../../structures/Command');
const { sortByName } = require('../../util/Util');
const { sortByName, embedURL } = require('../../util/Util');
module.exports = class GenerateCreditCommand extends Command {
constructor(client) {
@@ -43,9 +43,9 @@ module.exports = class GenerateCreditCommand extends Command {
}
credit = sortByName(credit, 'name');
const mapped = credit
.map(c => `- [${c.name}](${c.url})\n${sortByName(c.commands, 'name').map(cmd => {
.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} ([${cmd.reason}](${cmd.reasonURL}))`;
return ` * ${cmd.name} (${embedURL(c.reason, c.reasonURL)})`;
}).join('\n')}`);
return msg.channel.send({ files: [{ attachment: Buffer.from(mapped.join('\n')), name: 'credit.txt' }] });
}