-
-
Notifications
You must be signed in to change notification settings - Fork 363
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
UpdateGroupParticipants 403 error #441
Comments
message := ""
if evt.Message.GetConversation() != "" {
message = evt.Message.GetConversation()
}
words := strings.Split(message, " ")
data := strings.Split(words[1], "\n")
groupId := data[0]
groupJID := types.JID{
User: groupId,
Server: types.GroupServer,
}
numbers := data[1:]
invalid := []string{}
for _, n := range numbers {
jids := map[types.JID]whatsmeow.ParticipantChange{}
if strings.HasPrefix(n, "08") {
n = strings.Replace(n, "08", "628", 1)
}
jids[types.JID{
User: n,
Server: types.DefaultUserServer,
}] = whatsmeow.ParticipantChangeAdd
x, err := a.client.UpdateGroupParticipants(groupJID, jids)
if err != nil {
return err
}
c := x.GetChildrenByTag("add")
c = c[0].GetChildrenByTag("participant")
if c == nil {
continue
}
c1 := c[0].Attrs["error"]
if c1 == nil {
continue
}
v := c1.(string)
if v == "403" {
invalid = append(invalid, n)
}
}
c := strings.Join(invalid, "\n")
msg := &whatsmeow_proto.Message{
Conversation: &c,
}
_, err := a.client.SendMessage(ctx, evt.Info.Chat, msg)
if err != nil {
return err
}
return nil |
example of message
|
You can send GroupInviteMessage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
got error 403 when calling
UpdateGroupParticipants
typeParticipantChangeAdd
my account is already admin on the group
but i can invite them manually from my phone
The text was updated successfully, but these errors were encountered: