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
+2 -2
View File
@@ -1,7 +1,7 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { shorten, base64 } = require('../../util/Util');
const { shorten, base64, embedURL } = require('../../util/Util');
const { GITHUB_USERNAME, GITHUB_PASSWORD, XIAO_GITHUB_REPO_USERNAME, XIAO_GITHUB_REPO_NAME } = process.env;
module.exports = class ChangelogCommand extends Command {
@@ -34,7 +34,7 @@ module.exports = class ChangelogCommand extends Command {
.setColor(0x7289DA)
.setURL(`https://github.com/${XIAO_GITHUB_REPO_USERNAME}/${XIAO_GITHUB_REPO_NAME}/commits/master`)
.setDescription(commits.map(commit => {
const hash = `[\`${commit.sha.slice(0, 7)}\`](${commit.html_url})`;
const hash = embedURL(`\`${commit.sha.slice(0, 7)}\``, commit.html_url);
return `${hash} ${shorten(commit.commit.message.split('\n')[0], 50)} - ${commit.author.login}`;
}).join('\n'));
return msg.embed(embed);