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 -1
View File
@@ -1,6 +1,7 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
const { MessageEmbed } = require('discord.js');
const { embedURL } = require('../../util/Util');
module.exports = class DoomsdayClockCommand extends Command {
constructor(client) {
@@ -26,7 +27,7 @@ module.exports = class DoomsdayClockCommand extends Command {
const time = text.match(/<h3 class="uabb-infobox-title">(.+)<\/h3>/)[1];
const year = text.match(/<h5 class="uabb-infobox-title-prefix">(.+)<\/h5>/)[1];
const description = text.match(/<div class="uabb-infobox-text uabb-text-editor">.+<p>(.+)<\/p>/)[1]
.replace(/<a href="(.+)" target="_blank" rel="noopener">(.+)<\/a>/, '[$2]($1)')
.replace(/<a href="(.+)" target="_blank" rel="noopener">(.+)<\/a>/, embedURL('$2', '$1'))
.replace(/<em>(.+)<\/em>/i, '_$1_');
const embed = new MessageEmbed()
.setTitle(`${year}: ${time}`)