```go lang
func (wpp *waHandler) HandleTextMessage(message whatsapp.TextMessage) {
fmt.Printf("message %v \nchat %v %v %v sender: %v %v %v \n %v \n\n-------\n\n",
message.Info.Id,
wpp.c.Store.Chats[message.Info.RemoteJid].Name, wpp.c.Store.Chats[message.Info.RemoteJid].Jid, message.Info.RemoteJid,
message.Info.PushName, message.Info.SenderJid, message.ContextInfo.Participant,
message.Text)
// fmt.Printf("%v %v %v %v %v %v\n\t%v\n", message.Info.Timestamp, message.Info.Id, message.Info.RemoteJid, message.Info.SenderJid, message.ContextInfo.Participant, message.ContextInfo.QuotedMessageID, message.Text)
}
````
Output:
message 91DA7C773E616AF6AE204AD61B8E882C
chat Lecy [email protected] [email protected] sender:
N茫o haver谩 mais reuni茫o amanh茫
-------
message EDBCB2503E3ADD135BC26D2A41C4DDAA
chat Lecy [email protected] [email protected] sender:
馃グ馃グ馃グ
-------
message 00CD056CCDBB2479CAF27D45782951DF
chat Lecy [email protected] [email protected] sender:
Venha com Deus.
-------
Yes, I have the same problem
I'm still with the problem. I really need some way to solve this or some idea to how to solve this.
If you just want the sender JID for knowing the message sender in a group, just use the following:
var jid string
if message.Info.Source.Participant == nil {
jid = message.Info.RemoteJid
}else{
jid = *message.Info.Source.Participant
}
Unfourtenately, I have the same problem and dont know how to solve it. Tried many ways, but without any result
Unfourtenately, I have the same problem and dont know how to solve it. Tried many ways, but without any result
Hi, the following suggestion (by @cianoscatolo ) worked to me.
If you just want the sender JID for knowing the message sender in a group, just use the following:
var jid string if message.Info.Source.Participant == nil { jid = message.Info.RemoteJid }else{ jid = *message.Info.Source.Participant }
maybe you can use contacts store ?
wac.Store.Contacts[senderJid]
Does anyone know how to retrieve the PushName? Or in which conditions the field is not empty?
I imagined that the PushName is only transmitted if the number is not in your contact list, but a quick test showed that even then it is empty.
Most helpful comment
If you just want the sender JID for knowing the message sender in a group, just use the following: