Documentation Index Fetch the complete documentation index at: https://cometchat-22654f5b-release-unreal-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Groups let multiple users communicate in a shared conversation. The CometChat Unreal SDK provides async nodes for creating groups, joining existing ones, leaving, and sending/receiving group messages.
Group Lifecycle
Create a Group
Create a new group with a name and an initial set of member UIDs.
Call the Create Group Async node. Parameter Type Description Name FStringDisplay name for the group Member Ids TArray<FString>UIDs of users to add as initial members
On Success returns an FCometChatGroup with the server-assigned Guid.#include "AsyncActions/CometChatCreateGroupAction.h"
void AMyActor :: CreateLobbyGroup ()
{
TArray < FString > Members;
Members . Add ( TEXT ( "cometchat-uid-1" ));
Members . Add ( TEXT ( "cometchat-uid-2" ));
Members . Add ( TEXT ( "cometchat-uid-3" ));
auto * Action = UCometChatCreateGroupAction :: CreateGroupAsync (
this ,
TEXT ( "Game Lobby" ), // Group name
Members // Initial members
);
Action -> OnSuccess . AddDynamic ( this , & AMyActor ::OnGroupCreated);
Action -> OnFailure . AddDynamic ( this , & AMyActor ::OnGroupCreateFailed);
Action -> Activate ();
}
void AMyActor :: OnGroupCreated ( const FCometChatGroup & Group )
{
UE_LOG (LogTemp, Log, TEXT ( "Group created: %s (GUID: %s )" ),
* Group . Name , * Group . Guid );
}
void AMyActor :: OnGroupCreateFailed ( const FString & Error )
{
UE_LOG (LogTemp, Error, TEXT ( "Create group failed: %s " ), * Error);
}
Join a Group
Join an existing group by its GUID.
Call the Join Group Async node. Parameter Type Description Guid FStringThe unique identifier of the group to join
On Success fires with no output — the user is now a member.#include "AsyncActions/CometChatJoinGroupAction.h"
void AMyActor :: JoinGroup ( const FString & Guid )
{
auto * Action = UCometChatJoinGroupAction :: JoinGroupAsync ( this , Guid);
Action -> OnSuccess . AddDynamic ( this , & AMyActor ::OnGroupJoined);
Action -> OnFailure . AddDynamic ( this , & AMyActor ::OnJoinFailed);
Action -> Activate ();
}
void AMyActor :: OnGroupJoined ()
{
UE_LOG (LogTemp, Log, TEXT ( "Successfully joined the group" ));
}
void AMyActor :: OnJoinFailed ( const FString & Error )
{
UE_LOG (LogTemp, Error, TEXT ( "Join failed: %s " ), * Error);
}
Leave a Group
Leave a group you’re currently a member of.
Call the Leave Group Async node. Parameter Type Description Guid FStringThe unique identifier of the group to leave
On Success fires with no output.#include "AsyncActions/CometChatLeaveGroupAction.h"
void AMyActor :: LeaveGroup ( const FString & Guid )
{
auto * Action = UCometChatLeaveGroupAction :: LeaveGroupAsync ( this , Guid);
Action -> OnSuccess . AddDynamic ( this , & AMyActor ::OnGroupLeft);
Action -> OnFailure . AddDynamic ( this , & AMyActor ::OnLeaveFailed);
Action -> Activate ();
}
void AMyActor :: OnGroupLeft ()
{
UE_LOG (LogTemp, Log, TEXT ( "Left the group" ));
}
void AMyActor :: OnLeaveFailed ( const FString & Error )
{
UE_LOG (LogTemp, Error, TEXT ( "Leave failed: %s " ), * Error);
}
Fetch Groups
Retrieve a list of groups with optional search and filters.
Call the Fetch Groups Async node with an FCometChatGroupsRequest struct. Set bJoinedOnly = true to only fetch groups the user has joined, or leave it false to browse all available groups. #include "AsyncActions/CometChatFetchGroupsAction.h"
void AMyActor :: FetchGroups ()
{
FCometChatGroupsRequest Request;
Request . Limit = 20 ;
Request . bJoinedOnly = true ;
auto * Action = UCometChatFetchGroupsAction :: FetchGroups ( this , Request);
Action -> OnSuccess . AddDynamic ( this , & AMyActor ::OnGroupsFetched);
Action -> OnFailure . AddDynamic ( this , & AMyActor ::OnFetchFailed);
Action -> Activate ();
}
Send a Group Message
Send a text message to all members of a group. See Send a Message → Group Messages for details.
Fetch Group Message History
Retrieve previous messages from a group with pagination. See Receive Messages → Group Messages for details.
FCometChatGroup Properties
Property Type Description GuidFStringServer-assigned unique group identifier NameFStringGroup display name DescriptionFStringGroup description text MemberIdsTArray<FString>UIDs of current group members
Next Steps
Send a Message Send messages to users and groups.
Real-Time Events Listen for messages, presence, typing, and more.