Horoscope

This commit is contained in:
Daniel Odendahl Jr
2017-05-16 12:51:35 +00:00
parent acf499fabe
commit 4fe49fe24a
5 changed files with 74 additions and 4 deletions
+4 -4
View File
@@ -19,13 +19,13 @@ module.exports = class TodayCommand extends Command {
try {
const { text } = await snekfetch
.get('http://history.muffinlabs.com/date');
const parsed = JSON.parse(text);
const events = parsed.data.Events;
const body = JSON.parse(text);
const events = body.data.Events;
const event = events[Math.floor(Math.random() * events.length)];
const embed = new RichEmbed()
.setColor(0x9797FF)
.setURL(parsed.url)
.setTitle(`On this day (${parsed.date})...`)
.setURL(body.url)
.setTitle(`On this day (${body.date})...`)
.setTimestamp()
.setDescription(`${event.year}: ${event.text}`);
return msg.embed(embed);