Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

How to use LoadMessagesBefore and LoadMessagesAfter #600

Closed joeengressia closed 2 years ago

joeengressia commented 2 years ago

I don't have problem when using LoadMessages function for getting last x messages.

but when I want to get the "after or before" messages by using message id, I'm having trouble. i got message "server responded with status 404".

any one can help how to use "LoadMessagesBefore and LoadMessagesAfter" function?

my code:

jidDest:="xxx@s.whatsapp.net" //phonenumber messageId:="46F8BE5627xxxxx" output, err :=wac.LoadMessagesBefore(jidDest, messageId, 10) log.Println(output, err)

joeengressia commented 2 years ago

sorry, it works. it turns out that the Message ID sent should be of the one who has the session (From me = true), otherwise 404 not found.

is that how it's used?