Shard Connections
I am using Discordjs v14.9.0
Since 2 days, randomly my bot gets disconnected from Discord API, after x numbers of hours. I found nothing in debug logs or shard log. I don't know, how to counter this problem.
Though, I was thinking, if we could use "Shard" Class to manually check its connection API after each Interval and if found closed, we just respawn it via "respawn()". I don't know, how to check the connection with API.
Can anyone guide me through this?
23 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.- Node Version: v18.13.0
- What I have made till now:
Unsure if this can help out but why not use the
shardError
event to have some additional debugging?I have that Event as well
What's the code you used for that? it's not in the snippet you sent.
umm, my snippet is regarding, What I want to make
2nd para in my post message.
yes but what code do you have for "shardError"
I don't see anything in your paragraph
just log
um
you mean,
shard.on("error", func)
?because on all your errors, you just try to respawn the shard without logging anything
https://old.discordjs.dev/#/docs/discord.js/14.11.0/class/Client?scrollTo=e-shardError
I don't see it here
in Shard class ^
docs*
The one I sent is apart of all the other events
yea, I have this one for logging
in sep file
and nothing logs either?
yep
nothing
odd. yeah probably best to wait for someone with more experience than me on this one
hm
its way odd, I am using the package at v14.9 since it's released. Since 2 days, it started doing that
update your package and try
I don't wanna hit downtime, cz of connection issues in new version
as said in announcement
How many servers is your bot in?
and im unsure about having any downtime with the latest version - 14.11.0
2100+
lemii see upgrading the stuff - https://github.com/discordjs/discord.js/issues/9139#issuecomment-1537589759
Though, I was thinking, if we could use "Shard" Class to manually check its connection API after each Interval and if found closed, we just respawn it via "respawn()". I don't know, how to check the connection with API.
What about this ??
I also think I am having a similar problem
Upgrading to v14.11 did not fix the issue for me, assuming that this problem is the same as mine
I've been talking about my problem in #Bot Shards Keep Reconnecting After Reboot. I just made a comment on that github issue you referenced.
ohk
I have updated to v14.11, less see how it goes
Issue resolved with updating Djs to v14.11.0