Problem with messages received from whtasapp web #568
Unanswered
ricardopereyra
asked this question in
WhatsApp protocol Q&A
Replies: 1 comment 1 reply
-
I had the same problem and ended up doing this: msg := t.Message.GetConversation()
if msg == "" {
if x := t.Message.GetExtendedTextMessage(); x != nil {
msg = *x.Text
}
} Basically it will get the conversation and fallback to ExtendedTextMessage. I'm not sure why there is this distinction though |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello. I have a problem when a message is received from whatsapp web: 18:28:04.683 [Client ERROR] Event handler panicked while handling a *events.Message: message recipient must be a user JID with no device part.
Debugging I found that on a cellphone message v.Info.Sender is [email protected], but on a web whatsapp message v.Info.Sender is xxxxxxxxxxxxx:[email protected].
Additionally, the text of the message is'nt in v.Message.GetConversation(), because an web whatsapp message have another structure:
v.Message: extendedTextMessage:{text:"Hi" contextInfo:{expiration:0 ephemeralSettingTimestamp:0 disappearingMode:{initiator:CHANGED_IN_CHAT}}} messageContextInfo:{deviceListMetadata:{senderKeyHash:"\xdbn\xed>\xf3$\x1f\xaa\x11[" senderTimestamp:1712857003 recipientKeyHash:"5\xb2\x1c\xb2/\xaf\\\xe6\x023" recipientTimestamp:1712858566} deviceListMetadataVersion:2}
My code is:
Is there another way to send messages received from whatsapp web? It's behavior is normal?
Thanks!
Ricardo
Beta Was this translation helpful? Give feedback.
All reactions