I want to make a random.cat integration in my discord bot. With code below i managed to get the JSON from http://random.cat/meow. Now i want to send the image with message.channel.send, but i can't get it to work. Any help? (Real help, not "download some cats and make a random picker")
const Discord = require ("discord.js");
var request = require ("request");
const TOKEN = "Hidden"
const PREFIX = "`"
var cat = "http://random.cat/meow"
bot.on("message", function(message) {
if (message.author.equals(bot.user))return;
if (!message.content.startsWith(PREFIX)) return;
var args = message.content.substring(PREFIX.length).split(" ");
switch (args[0].toLowerCase()) {
case "cat":
request({
url: cat,
json: true
}, function (error, response, body) {
console.log(body);
})
break;
}
});
bot.login(TOKEN)