Using json online

Heyo!

So, I’m trying to make something like https://aws.random.cat/meow however, when using my code with a discord bot, it isn’t working.. It makes me wonder if you can host json things online directly by using the below code:

document.body.innerHTML = "<pre style=\"word-wrap: break-word; white-space: pre-wrap;\">{\"file\":\"https:\\/\\/"+domain+"\\/images\\/hug\\/"+item+"\"}</pre>";

Furthermore, my bot code is:

const { MessageEmbed } = require('discord.js');
const axios = require('axios');
const {get} = require("snekfetch");

const embed = new MessageEmbed()
        .setColor("RANDOM")
        .setTitle("thingie")
        .setDescription("Loading...")
message.channel.send(embed).then(msg => {
    get('https://example.com/kiss').then(response => {
        setTimeout(function(){ 
            embed.setDescription("")
            embed.setImage(response.body.file)
            msg.edit(embed)
        }, 1500);
    });
})

My website is working perfectly and is showing exactly as in https://aws.random.cat/meow However, it still doesn’t work. Please lmk how or why this is happening.

P.S I didn’t include the modules.export part in the bot code cuz, I thought it was extra.

P.P.S The following is my current output: This

Thanks!

9 thoughts on “Using json online”

Leave a Comment