Hello.
My bot is randomly disconnecting without any error or message, I guess it loses connection or something.
I know there is a autoReconnect feature but I don't know how to use it.
In discord.js documentation says it autoreconnect after losing connection, but nothing about how to use it.
Can someone show me example how to use this feature?
Thanks.
(I know my english is not perfect, sorry about that.)
var cli = new Discord.Client({autoReconnect:true});
Don't ask it in here -_-, there is a server for that...
What those guys said!
It might be something you should add to the documentation (maybe here), or make it more prominent then, because I couldn't find this information either. So +1 @BlackWolfff.
and of course, right after I say that
https://discordjs.readthedocs.io/en/latest/docs_client.html#autoreconnect
Hi,
I know that the given answer was to use autoReconnect but that doesn't appear to be included to be included in the docs anymore (I checked https://discord.js.org/#/docs/main/stable/typedef/ClientOptions). Am I missing something? My bot is also going down at random time intervals without an error message.
autoreconnect is always enabled now, if your bot is going down you might want to look into internet stability issues.
Most helpful comment
var cli = new Discord.Client({autoReconnect:true});