Use embedURL when relevant

This commit is contained in:
Dragon Fire
2024-05-13 23:47:28 -04:00
parent 456281576b
commit 44f51bd219
9 changed files with 22 additions and 13 deletions
+4 -3
View File
@@ -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');