Verified Bot Doesn't Start
I have a verified discord bot that when starting it it does not work at all, the bot logs in but it never reaches the ready state. the same code works with the beta bot in 2 servers whilst the main is in 600+ servers. Screenshots include instancing and examples for commands (NOTE, the prod and dev thing are switched around because of me being stupid so its the other way round)
I use discord.js 14.16.0. I can't share much code but please lmk if you need anything
23 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ā
Marked as resolved by staffthe table is sent at the end of the ready event so the bot is technically starting but it just isn't accepting or reciving commands
and often the users table is NaN
please ping me in any responses
help would be mucho appreciated
the bot does turn on btw it just doesn't do any of the events
like messagecreate etc etc
tag suggestion for @wowie:
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
- Note: if you initialize your Client as
bot
or other identifiers you need to use these instead of client
- If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebinI added it @NyR lemme see if anything comes up
@NyR
[WS => Shard 0] Destroying shard
Reason: Zombie connection
Code: 4200
Recover: Resume
[WS => Shard 0] Connection status during destroy
Needs closing: true
Ready state: 1
[WS => Shard 0] Shard did not receive any guild packets in 15000 ms.
Unavailable guild count: 348
[WS => Shard 0] Connecting to wss://gateway-us-east1-d.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.21394262128504526; waiting 8825ms
[WS => Shard 0] Resuming session
resume url: wss://gateway-us-east1-d.discord.gg
sequence: 136
shard id: 0
[WS => Shard 0] Invalid session; will attempt to resume: false
[WS => Shard 0] Destroying shard
Reason: Invalid session
Code: 1000
Recover: Reconnect
[WS => Shard 0] Connection status during destroy
Needs closing: true
Ready state: 1
[WS => Shard 0] Cancelled initial heartbeat due to #destroy being called
[WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.14070840894605796; waiting 5804ms
[WS => Shard 0] Waiting for identify throttle
[WS => Shard 0] Identifying
shard id: 0
shard count: 1
intents: 63439
compression: none
[WS => Shard 0] Waiting for event ready for 15000ms
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
[WS => Shard 0] Destroying shard
Reason: Zombie connection
Code: 4200
Recover: Resume
[WS => Shard 0] Connection status during destroy
Needs closing: true
Ready state: 1
[WS => Shard 0] Shard did not receive any guild packets in 15000 ms.
Unavailable guild count: 400
[WS => Shard 0] Connecting to wss://gateway-us-east1-d.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.7337868602955251; waiting 30268ms
[WS => Shard 0] Resuming session
apparently there are a lot of zomby shards
well its very simple
i don't have sharding manager
and i
yeah sorry i was just getting the code
im not really sure what you mean by constructor, i make the main client just by logging in and doing it here
yeah sorry i was just typing out my response
well the code works on a dev token in 2 servers but when on the verified token on 500 ish servers it stops working
and this keeps being sent since i added client.error checks [WS => Shard 0] Cancelled initial heartbeat due to #destroy being called
[WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.33146396322520744; waiting 13672ms
[WS => Shard 0] Waiting for identify throttle
[WS => Shard 0] Identifying
shard id: 0
shard count: 1
intents: 63439
compression: none
[WS => Shard 0] Waiting for event ready for 15000ms
[WS => Shard 0] First heartbeat sent, starting to beat every 41250ms
[WS => Shard 0] Destroying shard
Reason: Zombie connection
Code: 4200
Recover: Resume
[WS => Shard 0] Connection status during destroy
Needs closing: true
Ready state: 1
[WS => Shard 0] Shard did not receive any guild packets in 15000 ms.
Unavailable guild count: 415
i have all intents on the bot but i'll try remove them and see
i need it for music sorry iforgot to mention that
[WS => Manager] Fetched Gateway Information
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 988
[WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json
[WS => Shard 0] Waiting for event hello for 60000ms
[WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.6824989004144624; waiting 28153ms
[WS => Shard 0] Waiting for identify throttle
[WS => Shard 0] Identifying
shard id: 0
shard count: 1
intents: 63179
compression: none
[WS => Shard 0] Waiting for event ready for 15000ms
it seems the ready event takes too long?
or something im not really sure
wait nvm first heartbeat sent
it didn't
48
improvements!
apparently a bunch of guildDelete is getting pushed rn
well the ready event pushed but thats not the true guild count
that might be a good sign
lets test it out
OH ITS WORKING
YAY
thats super weird
yeah that might be it
i have no idea how im going to fix that cause its an integral part of the bot
š
but i'll do my best i guess
do you mind if I add you for more advice about this directly, i'll try not to be annoying and spam you with questions
I've implemnted that now, i'll try see if i can optimize the codebase cause the ready event odes a bunch of stuff
alright, do you mind sending a friend request, you seem to know what you're doing so I'd like to be able to contact you as a last resort if i can;'t figure something out myself
I've been trying to fix this for about a week now I recoded a bunch of stuff and it didn't work so this was kinda my last resort š
Just ask here
alr thats fine
thanks so much for your help, it means a lot!
Thank you for your help, i really appreciate it