-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
feat: add GroupJoinApprovalMode/GroupMemberAddMode/GroupUpdateDescrip… #660
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Module name has been changed to the contributor repository, I RECOMMEND REJECTING THE PR.
There is no reason to change the WhatsMeow module.
Sorry, I rolled back the module name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change this error message:
if mode != "on" && mode != "off" {
return fmt.Errorf("invalid mode %q", mode)
}
Therefore:
if mode != "on" && mode != "off" {
return errors.New("invalid mode, must be 'on' or 'off'")
}
It will help the user to better understand the error.
Leaving it the same as the GroupMemberAddMode
method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
group.go
Outdated
|
||
// GroupMemberAddMode sets the group member add mode to 'admin_add' or 'all_member_add'. | ||
func (cli *Client) GroupMemberAddMode(jid types.JID, mode string) error { | ||
if mode != "admin_add" && mode != "all_member_add" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to use the existing type rather than a string https://pkg.go.dev/go.mau.fi/whatsmeow/types#GroupMemberAddMode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's done.
group.go
Outdated
|
||
// GroupJoinApprovalMode sets the group join approval mode to 'on' or 'off'. | ||
func (cli *Client) GroupJoinApprovalMode(jid types.JID, mode string) error { | ||
if mode != "on" && mode != "off" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it should be a boolean rather than a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's done
This commit introduces new functionality that enables group join approval (GroupJoinApprovalMode), control over how new members are added (GroupMemberAddMode), and the ability to update group descriptions (GroupUpdateDescription).