#Client is in a strange ready/not ready state

20 messages · Page 1 of 1 (latest)

cinder hollow
#

https://github.com/ThreadedTickets/Bot/tree/migrate-to-bridge-v2

sharding file: https://github.com/ThreadedTickets/Bot/blob/migrate-to-bridge-v2/src/cluster.ts

Using worker processes, all the socket connections are working as intended

index.ts: https://github.com/ThreadedTickets/Bot/blob/migrate-to-bridge-v2/src/index.ts

All 3 ways of logging the token return the correct token

ready event: https://github.com/ThreadedTickets/Bot/blob/migrate-to-bridge-v2/src/events/ready.ts

The console.log in here logs this: READY null false 0 Screws

Error: (I get this error whenever my bot tried to make an api call. )

Unhandled Rejection Expected token to be set for this request, but none was present
Error: Expected token to be set for this request, but none was present

The screenshot is of the bridge server, showing that the bot is reporting ready
I am running the bot with IS_PROD=false so none of the prod functions are being called. the set status file is also not being run as i have not set the env variables
There are 0 errors when the bot actually logs in using client.login() and no logs showing that it gets disconnected

any other info that you might want just ping me and i can add it in

covert spearBOT
cinder hollow
#

using node 20.19.4

graceful spruce
#

Can you use the client provided as event parameter by djs instead of your manually added first parameter?

cinder hollow
graceful spruce
#

No, I mean that your events emit with three parameters but you only take one in your ready.ts file

#

The third parameter would be the one emitted by djs

cinder hollow
#

still gives this: READY null false 0 Screws

cinder hollow
graceful spruce
#

And can you log client.ws.destroyed too please?

#

Because it looks like your logoutShard event happens before the ready event of djs causing you to destroy the client

cinder hollow
#

djs 14.21.0

#

looks like it does, ill have to have a look at why

#

ah thanks, looks like its fixed

graceful spruce
#

Wait, why do you have a ShardingManager inside the socket you import in the file you define your client? That looks like a bad loop

cinder hollow
#

im guessing you mean index.ts?
its cause the bot will tell the bridge that its ready to start that shard then the bridge will send an ok

#

was also gonna ask, how do i setup the @discord.js/proxy or do i just install it

graceful spruce
#

Your setup is confusing to say the least