asternic / wuzapi

Simple RESTful API for WhatsApp in Golang (using the Whatsmeow multi device library)
MIT License
105 stars 58 forks source link

No webhook for voice messages #31

Open andreydruz opened 3 months ago

andreydruz commented 3 months ago

Hello,

I'm trying to read voice messages, but the webhook doesn't work on them.

Is it by design, or did I make some installation or configuration errors?

2024-03-27T18:18:43Z INF Message Received | role=server host=0.0.0.0 id=E681F395EBE43BD9463D1BD84C8154E8 source=******@s.whatsapp.net parts=pushname: ******, timestamp: 2024-03-27 18:18:43 +0000 UTC, type: media

2024-03-27T18:19:50Z INF Chat Presence received | role=server host=0.0.0.0 state=composing media=audio chat=******@s.whatsapp.net sender=******@s.whatsapp.net

2024-03-27T18:19:50Z WRN Skipping webhook. Not subscribed for this type | role=server host=0.0.0.0 type=ChatPresence

2024-03-27T18:19:52Z INF Chat Presence received | role=server host=0.0.0.0 state=paused media= chat=******@s.whatsapp.net sender=******@s.whatsapp.net

2024-03-27T18:19:52Z WRN Skipping webhook. Not subscribed for this type | role=server host=0.0.0.0 type=ChatPresence

2024-03-27T18:19:53Z INF Message Received | role=server host=0.0.0.0 id=12D1A7116861B1EB87FB7EF1943E8B86 source=******@s.whatsapp.net parts=pushname: ******, timestamp: 2024-03-27 18:19:53 +0000 UTC, type: media

2024-03-27T18:19:59Z INF Chat Presence received | role=server host=0.0.0.0 state=composing media=audio chat=******@s.whatsapp.net sender=******@s.whatsapp.net

2024-03-27T18:19:59Z WRN Skipping webhook. Not subscribed for this type | role=server host=0.0.0.0 type=ChatPresence

2024-03-27T18:20:02Z INF Chat Presence received | role=server host=0.0.0.0 state=paused media= chat=******@s.whatsapp.net sender=******@s.whatsapp.net

2024-03-27T18:20:02Z WRN Skipping webhook. Not subscribed for this type | role=server host=0.0.0.0 type=ChatPresence

2024-03-27T18:20:02Z INF Message Received | role=server host=0.0.0.0 id=1ABDEE55801B3CBB35209528F5085616 source=******@s.whatsapp.net parts=pushname: ******, timestamp: 2024-03-27 18:20:02 +0000 UTC, type: media
asternic commented 3 months ago

If you mean PTT audios, they will fire a webhook as any other message type. The error you posted is because of not being subscribed to ChatPresence, but those particular messages are NOT the actual audio message being sent, but the intermediate statuses while the audio is being recorded. You can subscribe to All or some events on /session/connect. Seems you did not subscribe to ChatPresence, you can add that if you want to get those chatpresence statues (user is recording audio, user is typing, etc)

ruben18salazar3 commented 1 month ago

Tampoco consigo recibir las notas de voz mediante los webhooks, solo recibo los eventos de composing/paused.

Esto solo acontece para las notas de voz, cuando intento recibir imágenes, videos, documentos, llegan sin problemas.

Será un problema general??