tawn33y / whatsapp-cloud-api

A Node.js library for creating bots and sending/receiving messages using the Whatsapp Cloud API.
https://www.npmjs.com/package/whatsapp-cloud-api
GNU General Public License v3.0
189 stars 51 forks source link

Contacts type message payload changing type when context is added #61

Closed guskuma closed 4 months ago

guskuma commented 1 year ago

When receiving a forwarded "contacts" type message, Message "data" property that was supposed to be a Contact array, turns into an object filled with Contacts and a "context" property.

Adding context to message.data is causing this issue: https://github.com/tawn33y/whatsapp-cloud-api/blob/32270afa807b398f4d02e91a7018f0c1721f0575/src/startExpressServer.ts#L113

This can be solved by moving "context" property to Message. @tawn33y tell me if this is ok for you and I can do it and open a PR.

Thanks in advance.

tawn33y commented 4 months ago

Closing - please read more here.