timotejroiko/discord.js-light

Shard 0 keeps reconnecting

emortaldev opened this issue · 2 comments

image

I'm guessing this isn't supposed to be happening? I haven't tested whether or not it can still receive messages while it's reconnecting but it keeps saying that in console

There was a rare issue with discord.js where shards randomly disconnect and refuse to reconnect. It is unknown whether this issue still exists or not, but i didnt want to take my chances and created my own workaround for it.

This workaround monitors shard activity and forces it to reconnect if it becomes inactive for over 10 minutes, which looks like what is happening given that you only have 1 guild.

You can fix this by increasing the shardCheckInterval in the client options, or setting it to 0 to completely disable it:

client = new Discord.Client({
    shardCheckInterval: 7200 // reconnect if inactive for 2 hours. Or set to 0 to disable
})

Ah I see. It doesn't seem to be doing it now that it's playing music in a voice channel in that guild. Thanks for the fix! Good work on the library btw! Amazing ram usage. ;)