What resource can be replaced here?

  • 0
    robot.on("message", message => {
        if (message.content === ".meme") {
            const embed = new Discord.MessageEmbed()
            got('https://www.reddit.com/r/memes/random/.json').then(response => {
                let content = JSON.parse(response.body);
                let permalink = content[0].data.children[0].data.permalink;
                let memeUrl = `https://reddit.com${permalink}`;
                let memeImage = content[0].data.children[0].data.url;
                let memeTitle = content[0].data.children[0].data.title;
                let memeUpvotes = content[0].data.children[0].data.ups;
                let memeDownvotes = content[0].data.children[0].data.downs;
                let memeNumComments = content[0].data.children[0].data.num_comments;
                embed.setTitle(`${memeTitle}`)
                embed.setURL(`${memeUrl}`)
                embed.setImage(memeImage)
                embed.setColor('RANDOM')
                embed.setFooter(` ${memeUpvotes}  ${memeDownvotes}  ${memeNumComments}`)
                message.channel.send(embed);
            })
        }
    })


    The command .meme will display a random joke from reddit, and is there any similar Russian-language resource with which you can do this, because not all users have knowledge of English to understand these jokes;)
    JavaScript Ryder Ramirez, Nov 17, 2019

  • 1 Answers
  • 0
    https://idaprikol.com/top-memes

    Open browser DevTools and see API requests
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!