mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update 0.Base.ts
This commit is contained in:
@@ -94,6 +94,7 @@ export class WAConnection extends EventEmitter {
|
|||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
super ()
|
super ()
|
||||||
|
this.setMaxListeners (20)
|
||||||
this.on ('CB:Cmd,type:disconnect', json => (
|
this.on ('CB:Cmd,type:disconnect', json => (
|
||||||
this.state === 'open' && this.unexpectedDisconnect(json[1].kind || 'unknown')
|
this.state === 'open' && this.unexpectedDisconnect(json[1].kind || 'unknown')
|
||||||
))
|
))
|
||||||
@@ -185,8 +186,8 @@ export class WAConnection extends EventEmitter {
|
|||||||
(resolve, reject) => {
|
(resolve, reject) => {
|
||||||
onRecv = resolve
|
onRecv = resolve
|
||||||
onErr = ({reason}) => reject(new Error(reason))
|
onErr = ({reason}) => reject(new Error(reason))
|
||||||
this.once (`TAG:${tag}`, onRecv)
|
this.on (`TAG:${tag}`, onRecv)
|
||||||
this.once ('ws-close', onErr) // if the socket closes, you'll never receive the message
|
this.on ('ws-close', onErr) // if the socket closes, you'll never receive the message
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return result as any
|
return result as any
|
||||||
|
|||||||
Reference in New Issue
Block a user