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
742 stars 160 forks source link

client.login() stopped working for me #559

Closed HL23252 closed 1 year ago

HL23252 commented 1 year ago

Which package has the bugs?

The core library

Issue description

Approximately 1 month ago I was using v2.10.1 and it was working fine with client.login('token') however, today I've tried using it again and came across some websocket error, after updating to the current version v2.11.1 websocket error is gone but now client.login('token') doesn't work and instead crashes my app. Tried debugging and realised that I have to parse token in an array for my app to not crash when using client.login(['token']). However now it gives invalid token error:

Uncaught (in promise) Error [TOKEN_INVALID]: An invalid token was provided.

Code sample

const { Client } = window.require('discord.js-selfbot-v13');

const client = new Client({
            captchaService:'2captcha',
            captchaKey:JSON.parse(localStorage.getItem('2captcha')) 
        });
        console.log('after client')
        console.log(client);
        client.on('ready', async() => {
            console.log(`${client.user.username} is ready!`);
            console.log(client);

        });
        await client.login('[discordtoken]');

Package version

v2.11.1

Node.js version

v16.13.1

Operating system

windows

Priority this issue should have

Medium (should be fixed soon)

Checklist

Additional Information

No response

aiko-chan-ai commented 1 year ago

you should check the token

client.on('debug', console.log)
HL23252 commented 1 year ago

Not sure if I'm doing it right.

Tried doing: client.on('debug',console.log); client.login(['token']); but same error as before popped up "Uncaught (in promise) Error [TOKEN_INVALID]: An invalid token was provided.."

Changed code to this: client.on('debug',console.log(client)); client.login(['token']);

This error pops up:

Uncaught (in promise) TypeError: The "listener" argument must be of type function. Received undefined at node_internal_captureLargerStackTrace (node:internal/errors:477:5) at new NodeError (node:internal/errors:387:5) at nodeinternal (node:internal/validators:247:11) at checkListener (node:events:266:3) at _addListener (node:events:546:3) at Client.addListener (node:events:605:10)

aiko-chan-ai commented 1 year ago
client.login(['token']);

['token'] is an array?
HL23252 commented 1 year ago

Yes because doing it without an array crashes my app. Just tried doing it without an array client.login('token') and my app crashed but I got this on the console:

  Logging on with a user token is unfortunately against the Discord
  `Terms of Service` <https://support.discord.com/hc/en-us/articles/115002192352>
  and doing so might potentially get your account banned.
  Use this at your own risk.

node:events:513 Provided token: node:events:513 Preparing to connect to the gateway...

After this my app crashes and nothing happens

aiko-chan-ai commented 1 year ago

wut ?

aiko-chan-ai commented 1 year ago

I can't reproduce this error

HL23252 commented 1 year ago

hmm that's weird.. okay I'll try to find out more, thanks for the help anyways!

HL23252 commented 1 year ago

Seems like the crash happens from updating from v2.10.1 to v2.10.4 and after looking around online, common problems have been incompatibilities with electron and newer versions of node modules. Think it has to do with WebSocketShard update as on v.2.10.1 I will get WebSocketShard errors. Will try updating electron module and see if problem persists.

Edit: Yeah doesn't work even after updating electron.

aiko-chan-ai commented 1 year ago

https://github.com/aiko-chan-ai/discord.js-selfbot-v13/compare/2.10.0...2.11.1

hmm

HL23252 commented 1 year ago

Tried to login using discord.js' client.login and got this error

Uncaught (in promise) Error [TokenInvalid]: An invalid token was provided. at WebSocketManager.connect at Client.login

Any idea why this may be happening? I'm copying the token from the network tab on discord web browser so quite certain it's correct.

TheDevYellowy commented 1 year ago

discord.js' client.login only works for bots because of how some things are set up

GizziXZ commented 1 year ago

having the same problem here, just can't use selfbots at all

aiko-chan-ai commented 1 year ago

😢

GizziXZ commented 1 year ago

using the same token on discum works fine, the problem has to do with the library

aiko-chan-ai commented 1 year ago

i don't know why you get this error :c try send me the token you used

DogoCaraballo commented 1 year ago

I've tried logging in using a new's bot token but couldn't (Invalid token) Had to use a token from an old account (shorter token length) for the login to work.

Weird huh

I don't wanna make asumptions but probably we're in an arms-race against discord's anti-selfbot system.

aiko-chan-ai commented 1 year ago

Don't use bot tokens with this library

DogoCaraballo commented 1 year ago

Yeah mb, when I said 'bot token' I was actually referring to a selfbot token.

Newer tokens are longer (1 year ago was when I first saw a longer token) so I thought that discord was trying to fight self-botting.

aiko-chan-ai commented 1 year ago

i just created an account 2 weeks ago (no phone number) and it works perfectly

LimanGit commented 1 year ago

Mine also have the same problem. Can anyone help me?