Discord.js: How to use autoReconnect?

Created on 28 Jul 2016  路  7Comments  路  Source: discordjs/discord.js

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.)

question (please use Discord instead)

Most helpful comment

var cli = new Discord.Client({autoReconnect:true});

All 7 comments

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smchase picture smchase  路  3Comments

tom-barnes picture tom-barnes  路  3Comments

Alipoodle picture Alipoodle  路  3Comments

ghost picture ghost  路  3Comments

Acaretia picture Acaretia  路  3Comments