Skip to main content

Party Chat

Last updated on

When a party has been formed, its members can use the chat feature to communicate with each other. Every message sent will be received by all of the party members.

Send a Party Chat

The Lobby service will automatically direct a player's messages to their own party, so the player doesn't need to know their Party ID. The Party ID will be obtained automatically after the player has already joined the party.

FRegistry::Lobby.Connect();
FRegistry::Lobby.SetPartyMessageResponseDelegate(AccelByte::Api::Lobby::FPartyChatResponse::CreateLambda([](const FAccelByteModelsPartyMessageResponse& Result)
{
if (Result.Code == "0")
{
// Do something if PartyMessageResponseDelegate has been retrieved successfully
}
else
{
// Do something if PartyMessageResponseDelegate has an error
}
}));

FString Message = FString("Your Message");
FRegistry::Lobby.SendPartyMessage(Message);

Receive a Party Chat

A party chat can be received by registering to a party chat event.

FRegistry::Lobby.SetPartyChatNotifDelegate(AccelByte::Api::Lobby::FPartyChatNotif::CreateLambda([](const FAccelByteModelsPartyMessageNotice& Result)
{
// Do something if PartyChatMessageNotifDelegate has been retrieved successfully
}));