0

I have 2captcha and I can't use it because I don't know where to put the captcha token

I am trying to make a post request to the following endpoint:

https://discord.com/api/v9/invites/${link}\

But, i keep getting the following response:

{
  captcha_key: [ 'captcha-required' ],
  captcha_sitekey: '4c672d35-0701-42b2-88c3-78380b0db560',
  captcha_service: 'hcaptcha'
}

What i am trying to do is to write a script where i can join a discord server from a provided discord server invite link.

Below is the function I am using to make a request.

axios.request({
  method: 'post',
  url: `https://discordapp.com/api/v9/invites/${invite}`,
  headers: { 
    'Authorization': 'token',
    'authority': 'discord.com', 
    'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', 
    'accept-language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7', 
    'referer': 'https://discord.com/', 
    'sec-ch-ua': '"Not/A)Brand";v="99", "Google Chrome";v="115", "Chromium";v="115"', 
    'sec-ch-ua-mobile': '?0', 
    'sec-ch-ua-platform': '"Windows"', 
    'sec-fetch-dest': 'document', 
    'sec-fetch-mode': 'navigate', 
    'sec-fetch-site': 'same-origin', 
    'sec-fetch-user': '?1', 
    'upgrade-insecure-requests': '1', 
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
  },
  data: data
}).then((response) => {
  console.log(response);
})
octopi
  • 1

1 Answers1

0

I couldn't find the endpoint you are using in the docs of discord https://discord.com/developers/docs/resources/invite

But maybe you can use this library https://discord.js.org/

XYZ
  • 1
  • 1