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 request = require('node-superfetch');
const { MessageEmbed } = require('discord.js');
const { shorten } = require('../../util/Util');
const { shorten, embedURL } = require('../../util/Util');
module.exports = class NASACommand extends Command {
constructor(client) {
@@ -58,6 +58,6 @@ module.exports = class NASACommand extends Command {
return text
.replace(/<\/?b>/g, '**')
.replace(/<\/?i>/g, '*')
.replace(/<a href="(https?:\/\/[^ ]+)" rel="nofollow">([^<>]+)<\/a>/g, '[$2]($1)');
.replace(/<a href="(https?:\/\/[^ ]+)" rel="nofollow">([^<>]+)<\/a>/g, embedURL('$2', '$1'));
}
};