Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.07k stars 492 forks source link

LoadChatMessages correct handlers #389

Open Diden05 opened 4 years ago

Diden05 commented 4 years ago

https://github.com/Rhymen/go-whatsapp/blob/master/chat_history.go#L40 How to pass the necessary handlers to the function correctly? Initially, I set up handlers like this: wac[jid].AddHandler(&waHandler{wac[jid]})

then I want to get the last 10 messages: err := wac[jid].LoadChatMessages(rJid, count, messageId, owner, after, &waHandler{wac[jid]}) I put a conclusion, I get messages, but the handlers do not work :(

in the golang is completely green, something turns out something is not, I ask for help :(

waHandler type waHandler struct { c *whatsapp.Conn }

Diden05 commented 4 years ago

Maybe I somehow did not correctly describe the task? The task is to receive all chat messages, after a message with a specific id and pass them to the handler

KMACEL commented 3 years ago

@Diden05, I solved to my problem with "https://github.com/Rhymen/go-whatsapp/blob/459e3de9bfb6a2a39a3e2c6c7b9f168bf04c7d19/examples/chatHistory/history.go".