mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Swap back to random.cat
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "85.12.3",
|
||||
"version": "85.12.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user