How to reply a group message
GonzalezAtWork opened this issue · comments
Hello guys!
I am a bit lost and did not found a reply on google or here on how can I reply a Group Message?
I can still use SendMessage, creating a JID from the group, instead of a specifc user?
some directions, please?
thanks!
You can send a message (SendMessage) into where the chat (jid) coming from.
Chat evt.Info.Chat
, the Sender evt.Info.Sender
.
Lines 14 to 20 in 01b0547
None of those did not worked:
chatJid = types.NewJID(v.Info.Chat, types.DefaultUserServer)
chatJid = types.NewJID(v.Info.Chat.User, types.DefaultUserServer)
chatJid = types.NewJID(v.Info.Chat.Server, types.DefaultUserServer)
This do not give an error, but also did not send any response to the chat:
chatJid = types.NewJID(v.Info.Chat.User +"@" + v.Info.Chat.Server, types.DefaultUserServer)
(ends up with ID@g.us@s.whatsapp.net)
mycli.WAClient.SendMessage(context.Background(), chatJid, response)
You're way overthinking things
chatJid = v.Info.Chat
Maybe need new IDE for editing the code that support LSP.
ops, my bad:
chatJid = types.NewJID(v.Info.Chat.User, v.Info.Chat.Server)
this works
but nice to know that there is a simplier solution like you said! Thanks!
ops, my bad:
chatJid = types.NewJID(v.Info.Chat.User, v.Info.Chat.Server)
this worksbut nice to know that there is a simplier solution like you said! Thanks!
Actually, v.Info.Chat
is already types.JID
and doesn't need to be re-created it.