canove / whaticket-community

A very simple Ticket System based on WhatsApp messages, that allow multi-users in same WhatsApp account.
MIT License
1.55k stars 795 forks source link

Cannot send message to group api/messages/send [ERR_WAPP_INVALID_CONTACT] #506

Closed Luskan777 closed 1 year ago

Luskan777 commented 1 year ago

Hi,

I'm trying to send a message to the Whatsapp group, but it's returning the error ERR_WAPP_INVALID_CONTACT.

My HTTP Request:

image

The error message is made by this code: https://github.com/canove/whaticket-community/blob/910a6ec750482248d83cfc5c29464b2e94ddd859/backend/src/services/WbotServices/CheckIsValidContact.ts

the problem is returned because of a validation function when trying to create the contact "CheckIsValidContact". image It seems to me that the function to create the contact "CreateOrUpdateContactService" allows it to be created as a group, but this option is not provided in the API route api/messages/send.

Would it be possible to develop this option to send to the group in the api route "api/messages/send"?

Luskan777 commented 1 year ago

I solved the problem, and it's available by Fok made by me. I will not open a pull request.