Convert everything to superagent properly

This commit is contained in:
Daniel Odendahl Jr
2018-06-08 15:36:21 +00:00
parent 63f3398858
commit b4c815f403
17 changed files with 163 additions and 155 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ module.exports = class HolidaysCommand extends Command {
constructor(client) {
super(client, {
name: 'holidays',
aliases: ['google-calendar'],
aliases: ['google-calendar', 'holiday'],
group: 'events',
memberName: 'holidays',
description: 'Responds with today\'s holidays.'
+3 -1
View File
@@ -33,7 +33,9 @@ module.exports = class TodayInHistoryCommand extends Command {
async run(msg, { month, day }) {
const date = month && day ? `/${month}/${day}` : '';
try {
const { text } = await request.get(`http://history.muffinlabs.com/date${date}`);
const { text } = await request
.get(`http://history.muffinlabs.com/date${date}`)
.buffer();
const body = JSON.parse(text);
const events = body.data.Events;
const event = events[Math.floor(Math.random() * events.length)];