Closed HL23252 closed 1 year ago
you should check the token
client.on('debug', console.log)
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)
client.login(['token']);
['token'] is an array?
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:
After this my app crashes and nothing happens
wut ?
I can't reproduce this error
hmm that's weird.. okay I'll try to find out more, thanks for the help anyways!
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.
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.
discord.js' client.login only works for bots because of how some things are set up
having the same problem here, just can't use selfbots at all
😢
using the same token on discum works fine, the problem has to do with the library
i don't know why you get this error :c try send me the token you used
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.
Don't use bot tokens with this library
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.
i just created an account 2 weeks ago (no phone number) and it works perfectly
Mine also have the same problem. Can anyone help me?
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
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