WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API

Home Page:https://baileys.whiskeysockets.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Send Presence update or "typing..." not working.

sostenesapollo opened this issue · comments

I'm using the last version.

console.log('jid', jid);
await this.clientsMap.get(chat)?.conn?.presenceSubscribe(jid)
await this.clientsMap.get(chat)?.conn?.sendPresenceUpdate("available", jid);
await this.clientsMap.get(chat)?.conn?.sendPresenceUpdate("composing", jid);
await delay(500)
await this.clientsMap.get(chat)?.conn?.sendPresenceUpdate("composing", jid);
await delay(5000)

await this.sendMessage(chat, { type:'text', text: new Date().toDateString() }, jid)

Nothing happens.

this is what I expect: 'typing....'
image

Here it worked by reversing the order of these two lines

await this.clientsMap.get(chat)?.conn?.presenceSubscribe(jid)
await this.clientsMap.get(chat)?.conn?.sendPresenceUpdate("available", jid);

I first notify the user that I am online and then I can hear their presence