AI Integration Quick Reference
AI Integration Quick Reference
Add Members to Group
UseaddMembersToGroup() with the group GUID, a list of GroupMember objects, and an optional list of UIDs to ban.
- Java
- Kotlin
onSuccess() method of the CallbackListener, you will receive a HashMap which will contain the UID of the users and the value will either be success or an error message describing why the operation to add the user to the group or ban the user failed.
Real-Time Group Member Added Events
When a member is added to a group, existing members receive a real-time event inonMemberAddedToGroup() of the GroupListener class. The callback provides an Action object, the adding User, the added User, and the Group.
When a member is added by another user,
onMemberAddedToGroup() fires. When a user joins on their own, onGroupMemberJoined() fires instead.- Java
- Kotlin
Member Added to Group event in Message History
When fetching message history, if a member was added to a group the logged-in user is part of, the list will contain anAction message with these fields:
action-addedactionOn-Userobject containing the details of the user who was added to the groupactionBy-Userobject containing the details of the user who added the member to the groupactionFor-Groupobject containing the details of the group to which the member was added
GroupMember Payload Structure
GroupMember Object
GroupMember Object
The
GroupMember object extends User and contains all User fields plus group-specific fields:Sample GroupMember Object:
Next Steps
Kick Member
Remove members from groups
Change Member Scope
Update member roles and permissions
Retrieve Members
Fetch list of group members
Group Listeners
Handle real-time group events