mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 23:05:04 +02:00
Display links in all embed URLs
This commit is contained in:
@@ -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' }] });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user