Есть ли способ использовать прокси в этой форме в js? - PullRequest
0 голосов
/ 17 февраля 2020
const commando = require('discord.js-commando');
const bot = new commando.CommandoClient();
const { RichEmbed } = require('discord.js');
const superagent = require('superagent');

class RobloxCommand extends commando.Command {
    constructor(client) {
        super(client, {
            name: 'roblox',
            group: 'fun',
            memberName: 'roblox',
            guildOnly: false,
            description: 'Displays a random Roblox game!',
            throttling: {
                usages: 2,
                duration: 5,
            }
        });
    }

    async run(message, args) {
        let msg = await message.channel.send("Generating...")

        let {body} = await superagent
        .get(`https://games.roblox.com/v1/games/multiget-place-details?placeIds=${Math.floor(Math.random() * 100000 + 1)}`)
        if(!{body}) return message.channel.send('Oops! Something happended trying to fetch the JSON data. Please try again')
        let cEmbed = new RichEmbed()
        .setColor('RANDOM')
        .setAuthor('Pepsi Roblox', message.guild.iconURL)
        .setDescription(body.url)
        .setTimestamp()
        .setFooter('PEPSI Powered by ')

        message.channel.send({embed: cEmbed})

        msg.delete();
    };
};

module.exports = RobloxCommand;

API Roblox не позволяет приложениям использовать его (глупо), поэтому мне нужно использовать прокси, но я не знаю, как?

Я попытался, но мой друг потерпел неудачу не в сети, поэтому я не могу связаться с ним

...