asternic / wuzapi

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

sending to old group format #9

Closed punyahenry closed 1 year ago

punyahenry commented 1 year ago

Can't sending old format group.. curl -s -H 'Token: xxxxxxx' -H 'Content-Type: application/json' --data '{"Phone":"xxxxxxx9505041-1571989132@g.us","Body":"hihi kirain"}' http://localhost:3000/chat/send/text {"code":400,"error":"Could not parse Phone","success":false}

new group format is can send 12036308493933376119@g.us"

punyahenry commented 1 year ago

https://github.com/asternic/wuzapi/blob/8f8b57cc9c898881212fdc97ffa3258ab2435624/wmiau.go#L122

solve if you add some code to handle char - on wmiau.go line 122 like this if (c < '0' || c > '9') && c != '-' {