This commit is contained in:
Dragon Fire
2020-06-29 20:20:48 -04:00
parent c8156470e9
commit 6a3bcdb58c
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -25,13 +25,13 @@ module.exports = class CatCommand extends Command {
async run(msg) {
try {
const { body } = await request
.get('https://api.thecatapi.com/images/search')
.get('https://api.thecatapi.com/v1/images/search')
.query({
limit: 1,
mime_types: 'jpg,png'
})
.set({ 'x-api-key': THECATAPI_KEY });
return msg.say({ files: [body.file] });
return msg.say({ files: [body.images[0].url] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}