Swap back to random.cat

This commit is contained in:
Dragon Fire
2018-08-10 22:50:36 -04:00
parent b9e6620b4c
commit 411dc189d4
2 changed files with 3 additions and 7 deletions
+2 -6
View File
@@ -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!`);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "85.12.3",
"version": "85.12.4",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {