Comments (8)
I added the status field to the message info struct and a couple of constants for the different status so you can play around with it.
from go-whatsapp.
This is currently not possible, because we didn't map all required fields to our custom structs. From what I can see the message proto contains a status field, which can be one of
var WebMessageInfo_STATUS_name = map[int32]string{
0: "ERROR",
1: "PENDING",
2: "SERVER_ACK",
3: "DELIVERY_ACK",
4: "READ",
5: "PLAYED",
}
We have to either map a few more fields from the proto to our custom message structs or just return the proto without mapping it.
from go-whatsapp.
Thanks a lot!
Could you point me to code, that forces web whatsapp to notify your app handlers about incoming messages? Because something like this could be done in "read" acks for my sent messages.
Or how to implement custom handler for detecting "read acks"?
Thanks!
from go-whatsapp.
The actual calling of the handlers happen here. You probably have to imlement an small AckMessage
type and provide an handler interface for it (message types and handler interfaces). Here are the JSON messages getting "created". The ack messages are in the json format, so you have to check for acks and dispatch them seperatly with something like wac.handle(AckMessage{...})
. It is probaly easier to just implement the JsonMessageHandler
in your code and check for acks there
from go-whatsapp.
Oh i see! Perfect!
Simplified solution:
func (*WaHandler) HandleJsonMessage(message string) { fmt.Printf("STATUS RECEIVED :%v\n", message) }
Now i can extract info about message status and so on depends on ack 1-sent 2-delivered 3-read
["Msg",{"cmd":"ack","id":"xxxmessageidxxxx","ack":2,"from":"[email protected]","to":"[email protected]","t":1534427787}]
Thanks a lot!
from go-whatsapp.
How do I mark the message as read?
from go-whatsapp.
Oh i see! Perfect!
Simplified solution:
func (*WaHandler) HandleJsonMessage(message string) { fmt.Printf("STATUS RECEIVED :%v\n", message) }
Now i can extract info about message status and so on depends on ack 1-sent 2-delivered 3-read
["Msg",{"cmd":"ack","id":"xxxmessageidxxxx","ack":2,"from":"[email protected]","to":"[email protected]","t":1534427787}]
Thanks a lot!
how do extract json in go ?
please help me
from go-whatsapp.
Can anybody tell me how to check if message has been sent (w/o returned ID). Sometimes messages are sent, but no ID returned.
from go-whatsapp.
Related Issues (20)
- How to implement LiveLocation handling
- Get a group of users HOT 1
- No Online Acknowledge HOT 1
- How to encrypt chats data
- Any way to update client's status through api HOT 5
- Excuse me. Can it get the login status or lastseen of a non-contact? HOT 2
- invalid media hmac for audio messages, sended with drag-n-drop HOT 1
- cannot unmarshal array into Go value of type map[string]interface {} HOT 2
- Imposible scan the api qrcode from Whatsapp Bussines after today updates HOT 6
- Error after scan QR Code HOT 6
- I created an api but it has an error
- error creating connection: couldn't dial whatsapp web websocket: websocket: bad handshake HOT 3
- multidevice support HOT 1
- qrcode scan issue from Whatsapp Bussines after today update HOT 4
- I understand the code was abandoned ? HOT 1
- Use this API to send messages
- > error logging in: error during login: error decoding login resp: json: cannot unmarshal array into Go value of type map[string]interface {} HOT 2
- Is it possible to make the instance occupied 30-50mb RAM?
- Error try login
- websocket bad handsake HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-whatsapp.