appujet / lavamusic

lavalink music bot base in lavalink-client and discord.js v14
https://appujet.github.io/lavamusic/
GNU General Public License v3.0
576 stars 491 forks source link

Shards keep reconnecting (why is that happening?) #70

Closed SxMAbel closed 2 years ago

sandarutharuneth commented 2 years ago

Same as mine shards are reconnecting

appujet commented 2 years ago

Please ask in discord dev server there help us

SxMAbel commented 2 years ago

I think shards are reconnecting because you have to choose between erela or discord.js. either full erela or full discord.js

my other thought of shards reconnecting is because the database (maybe try using a different database provider?)

Jeve-Stobs commented 2 years ago

TL;DR: It's expected behaviour

Discord requests your bot to be disconnected randomly every 15 minutes to 4 hours, but it should automatically resume.

The bot shouldn't actually restart, it should just reconnect to the gateway. It doesn't add to any rate limit or connection limit and you shouldn't experience this very often if you have one shard or fewer.

SxMAbel commented 2 years ago

TL;DR: It's expected behaviour

Discord requests your bot to be disconnected randomly every 15 minutes to 4 hours, but it should automatically resume.

The bot shouldn't actually restart, it should just reconnect to the gateway. It doesn't add to any rate limit or connection limit and you shouldn't experience this very often if you have one shard or fewer.

I experience this very often like very very often. I only have 1 shard the shard name is Shard#0

40ACDE8C-76F4-4AC0-87D9-2DBB55570EFB 2B864330-C60E-492A-9C65-F0354E5AD9C1

Jeve-Stobs commented 2 years ago

That's still normal. I have a bot on two shards and it does the same thing. Discord just wants to make sure that your bot is alive. If it was spamming reconnects, then you would have to look at your code. I would recommend only using the webhook when the reconnection lasts for >30 sec.