This commit is contained in:
Daniel Odendahl Jr
2019-03-29 00:29:13 +00:00
parent 8772188ad3
commit fd6cc6f3b9
-3
View File
@@ -18,12 +18,9 @@ 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];
const image = text
.match(/<img class="uabb-photo-img wp-image-[0-9]+ size-full" src="(?:.+)" data-lazy-src="(.+)" alt=/)[1];
const embed = new MessageEmbed()
.setTitle(`${year}: ${time}`)
.setColor(0x000000)
.setThumbnail(image)
.setURL('https://thebulletin.org/doomsday-clock/current-time/')
.setAuthor('Bulletin of the Atomic Scientists', undefined, 'https://thebulletin.org/')
.setDescription(description.replace(/<a href="(.+)">(.+)<\/a>/, '[$2]($1)'));