mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.02k stars 796 forks source link

Status by 'typing' #771

Open VinicSilva opened 4 years ago

VinicSilva commented 4 years ago

How can I do to enter status by typing before sending the message to the contact?

andersondeoliveiramachado commented 4 years ago

window.Store.WapQuery.sendChatstateComposing('554599999999@c.us')

VinicSilva commented 4 years ago

@andersondeoliveiramachado The sendChatstateComposing function only works on the first call, when I call again, is not as successful.

Is it missing any parameters? Is it a callback or promise?

marcelocecin commented 4 years ago

fist call is to start typing, second one is to stop typing

VinicSilva commented 4 years ago

Making these two calls works, but then when I try to do it the same way, it doesn't work anymore.

marcelocecin commented 4 years ago

please share the code and the error

VinicSilva commented 4 years ago

I use this code in the browser: https://raw.githubusercontent.com/mukulhase/WebWhatsapp-Wrapper/master/webwhatsapi/js/wapi.js. I make both calls and it works the first time. Then I try to do the same process for the same number, but it doesn't show the 'typing' again. Captura de tela de 2020-01-13 09-56-12

marcelocecin commented 4 years ago

are you logged into whatsapp web with a different number?

VinicSilva commented 4 years ago

Yes, I have another number.

marcelocecin commented 4 years ago

try to use https://raw.githubusercontent.com/smashah/sulla/master/src/lib/wapi.js

VinicSilva commented 4 years ago

I used this one. It only works the first time I make both calls. but if I call again to run typing, it doesn't work anymore.

It only works the first time.

VinicSilva commented 4 years ago

If testing both calls will work, shows the typing, but if you do the same process again, it no longer appears.

marcelocecin commented 4 years ago

try like the source code: await Store.WapQuery.sendChatstateComposing(chatId)

VinicSilva commented 4 years ago

I sent some prints trying to demonstrate ...

Captura de tela de 2020-01-13 14-58-22 Captura de tela de 2020-01-13 14-58-18 Captura de tela de 2020-01-13 14-57-28 Captura de tela de 2020-01-13 14-57-10

VinicSilva commented 4 years ago

I want to be able to do several times the typing be triggered ...

marcelocecin commented 4 years ago

try with await Store.WapQuery.sendChatstateComposing("number@c.us") without window.

mikelustosa commented 4 years ago

Does it still work? I tried await window.Store.WapQuery.sendChatstateComposing ('5581xxxxxxx@c.us');

And there is no "Typing"

ghost commented 4 years ago

This is working for me, with the following downside: Only works once during 10 seconds. If you send a message to that chat it works again. Maybe someone could make it better.

` const sendTyping = async (chat) =>{

await window.Store.WapQuery.sendPresenceAvailable() window.Store.WapQuery.sendChatstateComposing(chat)

} `

dekkardnexus5 commented 3 years ago

Hi guys, I've tried all suggestions, but is not working... any updates?