mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +02:00
Convert everything to superagent properly
This commit is contained in:
@@ -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.'
|
||||
|
||||
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user