mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
auto connect socket
This commit is contained in:
@@ -34,11 +34,8 @@ export const makeSocket = (config: SocketConfig) => {
|
|||||||
const ws = new MobileSocket(config)
|
const ws = new MobileSocket(config)
|
||||||
ws.setMaxListeners(0)
|
ws.setMaxListeners(0)
|
||||||
|
|
||||||
if(!config.mobile) {
|
// if not mobile or already registered -> auto connect
|
||||||
// if not mobile -> auto connect
|
if(!config.mobile || config.auth.creds.registered) {
|
||||||
ws.connect()
|
|
||||||
} else if(config.auth.creds.registered) {
|
|
||||||
// if mobile and registered -> auto connect
|
|
||||||
ws.connect()
|
ws.connect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user