Struggling to get this one to work now;
const superagent = require("snekfetch");
const Discord = require('discord.js')
module.exports = {
name: "cat",
category: "fun",
description: "Sends a random image of a cat",
usage: "[command]",
run: async (client, message, args, level) => {
//command
superagent.get('https://nekos.life/api/v2/img/meow')
.end((err, response) => {
const lewdembed = new Discord.MessageEmbed()
.setTitle("Random cat")
.setImage(response.body.url)
.setColor(`#00FF00`)
.setFooter(`owo`)
.setURL(response.body.url);
message.channel.send(lewdembed);
})
}
};
Throwing up this error;
TypeError: Cannot read property 'body' of null
at /home/runner/Manias-Bot/commands/fun/cat.js:16:22
at /home/runner/Manias-Bot/node_modules/snekfetch/src/index.js:212:22
I can see the error is with (response.body.url), but unsure how to solve this. Any help?