From 411dc189d45ae168209513e39ca45c5eb18de0f9 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 10 Aug 2018 22:50:36 -0400 Subject: [PATCH] Swap back to random.cat --- commands/random/cat.js | 8 ++------ package.json | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/commands/random/cat.js b/commands/random/cat.js index 40eb3969..770ac0bd 100644 --- a/commands/random/cat.js +++ b/commands/random/cat.js @@ -1,6 +1,5 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); -const { THE_CAT_API_KEY } = process.env; module.exports = class CatCommand extends Command { constructor(client) { @@ -16,11 +15,8 @@ module.exports = class CatCommand extends Command { async run(msg) { try { - const { body, headers } = await request - .get('http://thecatapi.com/api/images/get') - .query({ api_key: THE_CAT_API_KEY }); - const format = headers['content-type'].replace(/image\//i, ''); - return msg.say({ files: [{ attachment: body, name: `cat.${format}` }] }); + const { body } = await request.get('https://aws.random.cat/meow'); + return msg.say({ files: [body.file] }); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/package.json b/package.json index 29a6587b..8d367b85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "85.12.3", + "version": "85.12.4", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {