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
834 stars 172 forks source link

TypeError: captcha.slice is not a function #798

Closed N1C0exe closed 10 months ago

N1C0exe commented 1 year ago

Which package has the bugs?

The core library

Issue description

Im using this function

await client.authorizeURL(authorizeURL, {
      guild_id: guildId,
      permissions: "2134207679", // your permissions
      authorize: true
    })

and worked fine until now because im getting this error : Error authorizing bot: TypeError: captcha.slice is not a function . It comes from here https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/75ad773ce91cb23dfe811d6a168c8afe512b7de9/src/rest/RequestHandler.js#L392 The error appear when the captcha variable https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/75ad773ce91cb23dfe811d6a168c8afe512b7de9/src/rest/RequestHandler.js#L381 return an object instead of a string : { token: ''P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.hKdwYX......................................... ', useragent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5614.0 Safari/537.36'

Code sample

//

Package version

2.14.8

Node.js version

v17.9.0

Operating system

debian

Priority this issue should have

High (immediate attention needed)

Checklist

Additional Information

No response

N1C0exe commented 1 year ago

I have tested this temp fix and seems to work fine immagine

aiko-chan-ai commented 1 year ago

do you use your own captcha solver (function) ?

N1C0exe commented 1 year ago

do you use your own captcha solver (function) ?

Nono im using ur lib and I have added 2captcha in the client like docs say

aiko-chan-ai commented 1 year ago

hmm...

aiko-chan-ai commented 1 year ago

i tried it but it still works

N1C0exe commented 1 year ago

i tried it but it still works

I saw that u made a commit

N1C0exe commented 1 year ago

whit ur new commit it gave me this : Error: Unknown Response

aiko-chan-ai commented 1 year ago

i don't know why but my api key is very normal

N1C0exe commented 1 year ago

i don't know why but my api key is very normal

are u not getting any type of error ?

N1C0exe commented 1 year ago

I dont understand why the captcha key is coming sometimes as string , sometimes as obj

aiko-chan-ai commented 1 year ago

i tried many times, it just return string

N1C0exe commented 1 year ago

i tried many times, it just return string

so strange becouse sometimes is returning this for me :

{
token: ''P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.hKdwYX......................................... ',
useragent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5614.0 Safari/537.36'

}

u can see also the useragent

N1C0exe commented 1 year ago

whit ur new commit it gave me this : Error: Unknown Response

oh I saw why :


  if (typeof res.data == 'string') {
                    resolve(res.data);
                  } else {
                    reject(new Error('Unknown Response'));
                  }
aiko-chan-ai commented 1 year ago

yep

N1C0exe commented 1 year ago

yep

https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/798#issuecomment-1678163292 this little trick is working if u want to commit it

aiko-chan-ai commented 1 year ago

you can create a PR