aiko-chan-ai / discord.js-selfbot-v13

An unofficial discord.js fork for creating selfbots
https://discordjs-self-v13.netlify.app
GNU General Public License v3.0
741 stars 160 forks source link

DiscordAPIError: You need to update your app to join this server. #522

Closed Strooss closed 1 year ago

Strooss commented 1 year ago

Which package has the bugs?

The core library

Issue description

Trying to join a server

Code sample

async function joinGuild(code, client) {
  if (!code || !client || !client.isReady()) return false;
  let invite = await client.fetchInvite(code);
  if (!invite) return false;
  try {
    const guild = await invite.acceptInvite(true);
    return guild;
  } catch (err) {
    console.log(err);
    return false;
  }
}


### Package version

2.10.1

### Node.js version

v17.9.1

### Operating system

Windows

### Priority this issue should have

High (immediate attention needed)

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shared the entire traceback.
- [X] I am using a user token (and it isn't visible in the code).

### Additional Information

_No response_
aiko-chan-ai commented 1 year ago

full error .-.

Strooss commented 1 year ago

full error .-.

DiscordAPIError: You need to update your app to join this server.
a9b5fb07-92ff-493f-86fe-352a2803b3df
hcaptcha
pbiilv9W4bcG/L936Pr94mjxP2t65UcsswVZZ/CB8niFFchkSzfVp+YOhpkiPouyjY7s4xQZH4XWh8/DqYkxYDGFnc+tvedClO+1TfZ/lT4qtLOWUuxIt7hTB1i0SQtlKeDKyVqyuOGesBdQnK4Os16KdbEIuto8nhNU5frz
InBQUm9qVlY3OE1ja2s1REJIYTk4ZnRkcStiWE9TbWVaM2tPYzA4OXFHa08wdURMUEJpWlhLWE1DOWM0ci8rWEJUbjhIb2c9PVZYcDBVTzB5WjJPaVpPUUYi.Y-N0Tg.AcdXesunhaXJB_xXLaJkIdDGPHo
    at RequestHandler.execute (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:422:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:80:14)
    at async Invite.acceptInvite (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\structures\Invite.js:339:5)
    at async joinGuild (C:\Users\USER\Desktop\boostsBot\Utils\Functions.js:68:19)
    at async Client.<anonymous> (C:\Users\USER\Desktop\boostsBot\index.js:54:21) {
  method: 'post',
  path: '/invites/39aWSFuRP9',
  code: undefined,
  httpStatus: 400,
  captcha: {
    captcha_key: [ 'You need to update your app to join this server.' ],
    captcha_sitekey: 'a9b5fb07-92ff-493f-86fe-352a2803b3df',
    captcha_service: 'hcaptcha',
    captcha_rqdata: 'pbiilv9W4bcG/L936Pr94mjxP2t65UcsswVZZ/CB8niFFchkSzfVp+YOhpkiPouyjY7s4xQZH4XWh8/DqYkxYDGFnc+tvedClO+1TfZ/lT4qtLOWUuxIt7hTB1i0SQtlKeDKyVqyuOGesBdQnK4Os16KdbEIuto8nhNU5frz',
    captcha_rqtoken: 'InBQUm9qVlY3OE1ja2s1REJIYTk4ZnRkcStiWE9TbWVaM2tPYzA4OXFHa08wdURMUEJpWlhLWE1DOWM0ci8rWEJUbjhIb2c9PVZYcDBVTzB5WjJPaVpPUUYi.Y-N0Tg.AcdXesunhaXJB_xXLaJkIdDGPHo'
  },
  requestData: { json: {}, files: [] }
}
Strooss commented 1 year ago

also i need to put in an hcaptcha key? if yes i can use capmonster?

aiko-chan-ai commented 1 year ago

also i need to put in an hcaptcha key? if yes i can use capmonster?

currently i only support 2captcha. you can add manual captcha solving function https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/458#issuecomment-1373146340

Strooss commented 1 year ago

also i need to put in an hcaptcha key? if yes i can use capmonster?

currently i only support 2captcha. you can add manual captcha solving function #458 (comment)

How i get the capatcha image? and what should i return?

aiko-chan-ai commented 1 year ago

https://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/CustomCaptchaSolver

Strooss commented 1 year ago

https://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/CustomCaptchaSolver I see, i did this but it don't really works, it just return nothing .. im doing exactly like their documentation. do you have any idea?? https://www.npmjs.com/package/capmonster

const CapMonster = require("capmonster");
const captcha = new CapMonster('key');

const userclient = new Client({
    password: password,
    checkUpdate: false,
    captchaService: 'custom',
    captchaSolver: async (captchaData, userAgent) => {
      console.log(captchaData)
      let result = await captcha.decodeReCaptchaV2('https://discord.com/channels/@me', captchaData.captcha_sitekey);
      console.log(result)
      if (result.solution) return result.solution.gRecaptchaResponse;
    }
  });
aiko-chan-ai commented 1 year ago

https://discordjs-self-v13.netlify.app/#/docs/docs/main/typedef/CustomCaptchaSolver I see, i did this but it don't really works, it just return nothing .. im doing exactly like their documentation. do you have any idea?? https://www.npmjs.com/package/capmonster

const CapMonster = require("capmonster");
const captcha = new CapMonster('key');

const userclient = new Client({
    password: password,
    checkUpdate: false,
    captchaService: 'custom',
    captchaSolver: async (captchaData, userAgent) => {
      console.log(captchaData)
      let result = await captcha.decodeReCaptchaV2('https://discord.com/channels/@me', captchaData.captcha_sitekey);
      console.log(result)
      if (result.solution) return result.solution.gRecaptchaResponse;
    }
  });

hcaptcha, not recaptcha

aiko-chan-ai commented 1 year ago

but capmonster can't solve captcha when joining server

Strooss commented 1 year ago

but capmonster can't solve captcha when joining server

why? can you explain?

aiko-chan-ai commented 1 year ago
  captcha: {
    captcha_key: [ 'You need to update your app to join this server.' ],
    captcha_sitekey: 'a9b5fb07-92ff-493f-86fe-352a2803b3df',
    captcha_service: 'hcaptcha',
    captcha_rqdata: 'pbiilv9W4bcG/L936Pr94mjxP2t65UcsswVZZ/CB8niFFchkSzfVp+YOhpkiPouyjY7s4xQZH4XWh8/DqYkxYDGFnc+tvedClO+1TfZ/lT4qtLOWUuxIt7hTB1i0SQtlKeDKyVqyuOGesBdQnK4Os16KdbEIuto8nhNU5frz',
    captcha_rqtoken: 'InBQUm9qVlY3OE1ja2s1REJIYTk4ZnRkcStiWE9TbWVaM2tPYzA4OXFHa08wdURMUEJpWlhLWE1DOWM0ci8rWEJUbjhIb2c9PVZYcDBVTzB5WjJPaVpPUUYi.Y-N0Tg.AcdXesunhaXJB_xXLaJkIdDGPHo'
  },

this is the data returned from discord to solve this type of captcha need to add 3 parameters:

aiko-chan-ai commented 1 year ago

you can create a function that solves it yourself

Strooss commented 1 year ago

you can create a function that solves it yourself

How that? tried many libraries all of them don't works

aiko-chan-ai commented 1 year ago

you can create a function that solves it yourself

How that? tried many libraries all of them don't works

try axios / node-fetch

Strooss commented 1 year ago

you can create a function that solves it yourself

How that? tried many libraries all of them don't works

try axios / node-fetch

after some google search's, i did this :

captchaSolver: async (captchaData, userAgent) => {
      try {
        const createTaskResponse = await axios.post("https://api.capmonster.cloud/createTask", {
          clientKey: CAPMONSTER,
          task: {
            type: "HCaptchaTaskProxyless",
            websiteURL: "https://discord.com/channels/@me",
            websiteKey: captchaData.captcha_sitekey
          }
        });
        const taskId = createTaskResponse.data.taskId;
        let getResults = { status: "processing" };
        while (getResults.status === "processing") {
          const getResultsResponse = await axios.post("https://api.capmonster.cloud/getTaskResult", {
            clientKey: CAPMONSTER,
            taskId
          });
          getResults = getResultsResponse.data;
          await new Promise(resolve => setTimeout(resolve, 1000));
        }
        const solution = getResults.solution.gRecaptchaResponse;
        console.log(solution)
        return await solution;

      } catch (error) {
        console.error(error);
      }
    }

it return for me a result, it seems fine but i think ur package need another something to work or idk .. im getting this

    at RequestHandler.execute (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:422:13)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\rest\RequestHandler.js:80:14)
    at async Invite.acceptInvite (C:\Users\USER\Desktop\boostsBot\node_modules\discord.js-selfbot-v13\src\structures\Invite.js:339:5)
    at async joinGuild (C:\Users\USER\Desktop\boostsBot\Utils\Functions.js:104:19)
    at async Client.<anonymous> (C:\Users\USER\Desktop\boostsBot\index.js:51:21) {
  method: 'post',
  path: '/invites/39aWSFuRP9',
  code: undefined,
  httpStatus: 400,
  captcha: {
    captcha_key: [ 'captcha-required' ],
    captcha_sitekey: 'a9b5fb07-92ff-493f-86fe-352a2803b3df',
    captcha_service: 'hcaptcha',
    captcha_rqdata: '75KYUmxHtm0UfAHQVzByon01ApvLpTNYcf//w4UiqAUFIAPDwzwkBTzdX8cITuTLU2iNLarkZe/3RcBa8rWownB+VnzIpI8WqNymdMYgOWZrUNESOeBW621RYM6FW1ttMVwnTQ1WmHyE2//iv7Hj5iiqYL8J+m1EpPrrp4FE',
    captcha_rqtoken: 'Ik0yRFlFUHg1WHNEQXBmOGN4RmlpTmFXbHpxOWVPZ1B5TkxRTjZVQ2lwRVV5UHJPVU90SHBEWTkrdHBKU294QlZTZHQydEE9PTlxTCtISUt1UHRwNFh5aTMi.Y-OOvg.m-FQ1WQoaUKkwzioH91CeoXz9gE'
  },
  requestData: { json: {}, files: [] }
}
aiko-chan-ai commented 1 year ago

https://www.reddit.com/r/Discord_selfbots/comments/tq6g2v/captcha_bypass_new_captcha_keys_question/

Strooss commented 1 year ago

https://www.reddit.com/r/Discord_selfbots/comments/tq6g2v/captcha_bypass_new_captcha_keys_question/

That help me! i did this: but now im getting the same error as this guy 523

const createTaskResponse = await axios.post("https://api.capmonster.cloud/createTask", {
          clientKey: CAPMONSTER,
          task: {
            type: "HCaptchaTask",
            websiteURL: "https://discord.com/channels/@me",
            websiteKey: captchaData.captcha_sitekey,
            data: captchaData.captcha_rqdata,
            isInvisible: true,
            userAgent: userAgent
          }
        });
        const taskId = createTaskResponse.data.taskId;
        let getResults = { status: "processing" };
        while (getResults.status === "processing") {
          const getResultsResponse = await axios.post("https://api.capmonster.cloud/getTaskResult", {
            clientKey: CAPMONSTER,
            taskId
          });
          getResults = getResultsResponse.data;
          await new Promise(resolve => setTimeout(resolve, 1000));
        }
        const solution = getResults.solution.gRecaptchaResponse;
        console.log(solution)
        return await solution;
aiko-chan-ai commented 1 year ago

2.10.2