-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't send invite member #462
Comments
you can send GroupInviteMessage, if the user set private IDs := make(map[waTypes.JID]whatsmeow.ParticipantChange)
target, _ := waTypes.ParseJID(strings.Split(v.Message.GetConversation(), " ")[1]) // particicpant to add
IDs[target] = whatsmeow.ParticipantChangeAdd
mycli.WAClient.GetGroupInviteLink(v.Info.Chat, false)
add, _ := mycli.WAClient.UpdateGroupParticipants(v.Info.Chat, IDs)
addTag := add.GetChildByTag("add")
rest := addTag.GetChildByTag("participant")
errorCode := rest.Attrs["error"].(string)
if errorCode == "403" {
add_req := rest.GetChildByTag("add_request")
code := add_req.Attrs["code"].(string)
expCode := add_req.Attrs["expiration"].(string)
exp, _ := strconv.ParseInt(expCode, 10, 64)
groupInfo, _ := mycli.WAClient.GetGroupInfo(v.Info.Chat)
groupJid := v.Info.Chat.String()
caption := "TEST WHATSMEOW"
mycli.WAClient.SendMessage(context.Background(), target, &waProto.Message{
GroupInviteMessage: &waProto.GroupInviteMessage{
InviteCode: &code,
InviteExpiration: &exp,
GroupJid: &groupJid,
GroupName: &groupInfo.Name,
Caption: &caption,
// JpegThumbnail: ,
},
},)
} |
This was referenced Nov 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i'm trying to add member using UpdateGroupParticipants everything works fine but if member set privately it won't work nor i got any error response.
The text was updated successfully, but these errors were encountered: