snekfetch

This commit is contained in:
Daniel Odendahl Jr
2017-05-15 03:31:13 +00:00
parent d1148a0966
commit 87c0646233
40 changed files with 236 additions and 210 deletions
+3 -4
View File
@@ -1,6 +1,6 @@
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
const request = require('superagent');
const snekfetch = require('snekfetch');
module.exports = class TodayCommand extends Command {
constructor(client) {
@@ -17,9 +17,8 @@ module.exports = class TodayCommand extends Command {
if (!msg.channel.permissionsFor(this.client.user).has('EMBED_LINKS'))
return msg.say('This Command requires the `Embed Links` Permission.');
try {
const { text } = await request
.get('http://history.muffinlabs.com/date')
.buffer(true);
const { text } = await snekfetch
.get('http://history.muffinlabs.com/date');
const parsed = JSON.parse(text);
const events = parsed.data.Events;
const event = events[Math.floor(Math.random() * events.length)];