danielcardeenas / sulla

👩🏻‍🔬 Javascript Whatsapp api library for chatbots
MIT License
1.27k stars 271 forks source link

how to get status of session? #323

Open chitogamer96 opened 4 years ago

chitogamer96 commented 4 years ago

I have an api rest with express and I have a route to create new sessions but I would like to know if a connection has already been created and if so, then delete it and create it again

willianmaria commented 4 years ago

I would like to know too.

TheCBKM commented 4 years ago

there must be client.state() but you can grab session state by trying this

client.onStateChange((state) => { console.log(state); const conflits = [ sulla.SocketState.CONFLICT, sulla.SocketState.UNPAIRED, sulla.SocketState.UNLAUNCHED, ]; if (conflits.includes(state)) { client.useHere(); } }); `

joedutra commented 4 years ago

the repository is deprecated use

Install npm i @s2click/venom https://github.com/s2click/venom