mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Close before terminate + update presence on message receive
This commit is contained in:
@@ -17,10 +17,7 @@ async function example() {
|
||||
const conn = new WAConnection() // instantiate
|
||||
conn.autoReconnect = ReconnectMode.onConnectionLost // only automatically reconnect when the connection breaks
|
||||
conn.logLevel = MessageLogLevel.info // set to unhandled to see what kind of stuff you can implement
|
||||
// if the gap between two messages is greater than 10s, fail the connection
|
||||
conn.connectOptions.maxIdleTimeMs = 10*1000
|
||||
conn.connectOptions.regenerateQRIntervalMs = 5000
|
||||
// attempt to reconnect at most 10 times
|
||||
// attempt to reconnect at most 10 times in a row
|
||||
conn.connectOptions.maxRetries = 10
|
||||
conn.chatOrderingKey = waChatKey(true) // order chats such that pinned chats are on top
|
||||
|
||||
|
||||
Reference in New Issue
Block a user