From 6391e37198a08e861872d67d28585c916e1ffe2f Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 15 Oct 2020 16:53:48 +0530 Subject: [PATCH] Change default connect options --- README.md | 4 +++- package.json | 2 +- src/WAConnection/0.Base.ts | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 521f7cd..f984d0b 100644 --- a/README.md +++ b/README.md @@ -101,13 +101,15 @@ conn.connectOptions = { */ waitOnlyForLastMessage?: false /** max time for the phone to respond to a connectivity test */ - phoneResponseTime?: 7500 + phoneResponseTime?: 10_000 /** minimum time between new connections */ connectCooldownMs?: 3000 /** agent used for WS connections (could be a proxy agent) */ agent?: Agent = undefined /** agent used for fetch requests -- uploading/downloading media */ fetchAgent?: Agent = undefined + /** always uses takeover for connecting */ + alwaysUseTakeover: true } as WAConnectOptions ``` diff --git a/package.json b/package.json index 8af3096..2c33fb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@adiwajshing/baileys", - "version": "3.2.0", + "version": "3.2.1", "description": "WhatsApp Web API", "homepage": "https://github.com/adiwajshing/Baileys", "main": "lib/WAConnection/WAConnection.js", diff --git a/src/WAConnection/0.Base.ts b/src/WAConnection/0.Base.ts index 6d2c1d3..f2ffcbe 100644 --- a/src/WAConnection/0.Base.ts +++ b/src/WAConnection/0.Base.ts @@ -48,8 +48,8 @@ export class WAConnection extends EventEmitter { waitForChats: true, maxRetries: 5, connectCooldownMs: 3000, - phoneResponseTime: 7_500, - alwaysUseTakeover: false + phoneResponseTime: 10_000, + alwaysUseTakeover: true } /** When to auto-reconnect */ autoReconnect = ReconnectMode.onConnectionLost