mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Use embedURL when relevant
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { embedURL } = require('../../util/Util');
|
||||
const { dependencies, optionalDependencies } = require('../../package');
|
||||
const deps = Object.keys({ ...dependencies, ...optionalDependencies }).sort();
|
||||
|
||||
@@ -17,7 +18,7 @@ module.exports = class GenerateCreditCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const npm = `* ${deps.map(dep => `[${dep}](https://www.npmjs.com/package/${dep})`).join('\n* ')}`;
|
||||
const npm = `* ${deps.map(dep => embedURL(dep, `https://www.npmjs.com/package/${dep}`)).join('\n* ')}`;
|
||||
const list = this.client.registry.groups
|
||||
.map(g => {
|
||||
const commands = g.commands
|
||||
@@ -28,8 +29,8 @@ module.exports = class GenerateCreditCommand extends Command {
|
||||
const credits = c.credit
|
||||
.filter(cred => cred.name !== 'Dragon Fire')
|
||||
.map(cred => {
|
||||
const reason = cred.reasonURL ? `[${cred.reason}](${cred.reasonURL})` : cred.reason;
|
||||
return `[${cred.name}](${cred.url}) (${reason})`;
|
||||
const reason = cred.reasonURL ? embedURL(cred.reason, cred.reasonURL) : cred.reason;
|
||||
return `${embedURL(cred.name, cred.url)} (${reason})`;
|
||||
});
|
||||
return `* **${c.name}:**\n - ${credits.join('\n - ')}`;
|
||||
}).join('\n');
|
||||
|
||||
Reference in New Issue
Block a user