diff --git a/commands/events/doomsday-clock.js b/commands/events/doomsday-clock.js new file mode 100644 index 00000000..ab70e49a --- /dev/null +++ b/commands/events/doomsday-clock.js @@ -0,0 +1,28 @@ +const { Command } = require('discord.js-commando'); +const snekfetch = require('snekfetch'); +const { stripIndents } = require('common-tags'); + +module.exports = class DoomsdayClockCommand extends Command { + constructor(client) { + super(client, { + name: 'doomsday-clock', + group: 'events', + memberName: 'doomsday-clock', + description: 'Responds with the current time of the Doomsday Clock.' + }); + } + + async run(msg) { + try { + const { text } = await snekfetch.get('https://thebulletin.org/timeline'); + const time = text.match(/IT IS(?: STILL)? (.+) MINUTES TO MIDNIGHT/)[0]; + const desc = text.match(/