Loading...
Searching...
No Matches
AccelByte.Api.Chat Class Reference
Inheritance diagram for AccelByte.Api.Chat:

Public Member Functions

void Connect ()
 Establish a websocket connection to chat service.
void Disconnect ()
 Disconnect websocket connection from chat service.
void RefreshToken (string newToken, ResultCallback callback)
 Send a new access token to be used in chat service.
void CreatePersonalTopic (string otherUserId, ResultCallback< ChatActionTopicResponse > callback)
 Create a private topic with other user.
void CreateGroupTopic (string groupName, string[] adminUserId, string[] memberUserIds, ResultCallback< ChatActionTopicResponse > callback)
 Create a group topic It can be used to let multiple users connect to each other.
void CreateGroupTopic (string groupName, string[] adminUserId, string[] memberUserIds, CreateGroupTopicOptionalParameter optionalParameter, ResultCallback< ChatActionTopicResponse > callback)
 Create a group topic It can be used to let multiple users connect to each other.
void JoinTopic (string topicId, ResultCallback< ChatActionTopicResponse > callback)
 Join a specific topic id.
void DeleteTopic (string topicId, ResultCallback< ChatActionTopicResponse > callback)
 Delete a topic.
void SendChatMessage (string topicId, string message, ResultCallback< SendChatResponse > callback)
 Send chat message to a topic.
void QueryGroupTopic (string keyword, ResultCallback< QueryTopicResponse > callback, int offset=0, int limit=20)
 Query group topics that user is currently a part of.
void QueryPersonalTopic (string keyword, ResultCallback< QueryTopicResponse > callback, int offset=0, int limit=20)
 Query personal topics that user is currently a part of.
void QueryTopic (string keyword, ResultCallback< QueryTopicResponse > callback, int offset=0, int limit=20)
 Query group and personal topics that user is currently a part of.
void QueryTopic (string topicId, ResultCallback< QueryTopicByIdResponse > callback)
 Query group and personal topic by topic ID.
void QueryChat (string topicId, ResultCallback< QueryChatResponse > callback, int limit=20, DateTime lastChatCreatedAt=default(DateTime))
 Query chat messages within a topic.
void BlockUser (string userId, ResultCallback< BlockUnblockResponse > callback)
 Block user.
void UnblockUser (string userId, ResultCallback< BlockUnblockResponse > callback)
 Unblock user.
void QuerySystemMessage (ResultCallback< QuerySystemMessagesResponse > callback, QuerySystemMessageRequest request=default)
 Query system messages in user's system inbox.
void UpdateSystemMessages (HashSet< ActionUpdateSystemMessage > actionUpdateSystemMessages, ResultCallback< UpdateSystemMessagesResponse > callback)
 Update system message(s) in user system inbox.
void DeleteSystemMessages (HashSet< string > messageIds, ResultCallback< DeleteSystemMessagesResponse > callback)
 Delete system message(s) in user system inbox.
void GetSystemMessagesStats (ResultCallback< GetSystemMessageStatsResponse > callback, GetSystemMessageStatsRequest request=default)
 Get system messages stats.
void DeleteGroupChat (string groupId, string chatId, ResultCallback callback)
 Delete a message from group chat (used by group moderator).
void MuteGroupUserChat (string groupId, string userId, int durationInSeconds, ResultCallback callback)
 Mute user from group chat (used by group moderator).
void UnmuteGroupUserChat (string groupId, string userId, ResultCallback callback)
 Unmute user from group chat (used by group moderator).
void GetGroupChatSnapshot (string groupId, string chatId, ResultCallback< ChatSnapshotResponse > callback)
 Get chat snapshot (used by group moderator).
void BanGroupUserChat (string groupId, List< string > userIds, ResultCallback< BanGroupChatResponse > callback)
 Ban users from group chat (used by group moderator).
void UnbanGroupUserChat (string groupId, List< string > userIds, ResultCallback< UnbanGroupChatResponse > callback)
 Unban users from group chat (used by group moderator).
void GetUserChatConfiguration (ResultCallback< GetUserChatConfigurationResponse > callback)
 Get chat configuration for current user.
void SetUserChatConfiguration (bool isProfanityDisabled, ResultCallback< SetUserChatConfigurationResponse > callback)
 Set chat configuration for current user.

Properties

string SessionId [get]
 Session Id of the connection to chat service.
bool IsConnected [get]
Properties inherited from AccelByte.Core.WrapperBase
Utils.AccelByteIdValidator IdValidator [get]

Events

Action Connected
 Event triggered when websocket connection successfully connected.
Action< WsCloseCodeDisconnected
 Event triggered when a websocket connection is disconnected.
Action< EventAddRemoveFromTopicAddedToTopic
 Event triggered when user is added to a chat topic.
Action< EventAddRemoveFromTopicRemovedFromTopic
 Event triggered when user is added to a chat topic.
Action< EventTopicUpdatedTopicDeleted
 Event triggered when a chat topic is deleted.
Action< EventNewChatNewChatMessage
 Event triggered when a new chat message is received.
Action< UserBannedNotificationUserChatBanned
 Event triggered when user is banned from chatting when ban is CHAT_ALL, then user also will not receive new chat events.
Action< UserBannedNotificationUserChatUnbanned
 Event triggered when user is unbanned from chatting.
Action< SystemMessageNotifNewSystemMessage
 Event triggered when user receive new system message.
Action< ChatMutedNotifChatMuted
 Event triggered when user muted from group chat.
Action< ChatUnmutedNotifChatUnmuted
 Event triggered when user unmuted from group chat.

Member Function Documentation

◆ BanGroupUserChat()

void AccelByte.Api.Chat.BanGroupUserChat ( string groupId,
List< string > userIds,
ResultCallback< BanGroupChatResponse > callback )
inline

Ban users from group chat (used by group moderator).

Parameters
groupIdId of group from group service.
userIdsList of user ids to ban.
callbackFunction callback when operation is done.

◆ BlockUser()

void AccelByte.Api.Chat.BlockUser ( string userId,
ResultCallback< BlockUnblockResponse > callback )
inline

Block user.

Parameters
userIduser ID to block.
callbackFunction callback when operation is done.

◆ CreateGroupTopic() [1/2]

void AccelByte.Api.Chat.CreateGroupTopic ( string groupName,
string[] adminUserId,
string[] memberUserIds,
CreateGroupTopicOptionalParameter optionalParameter,
ResultCallback< ChatActionTopicResponse > callback )
inline

Create a group topic It can be used to let multiple users connect to each other.

Parameters
groupNamegroup chat name
adminUserIdlist of moderator/admin for this group chat
memberUserIdslist of members for this group chat
callbackResult of this operation
optionalParameteroptional parameter when create a group topic

◆ CreateGroupTopic() [2/2]

void AccelByte.Api.Chat.CreateGroupTopic ( string groupName,
string[] adminUserId,
string[] memberUserIds,
ResultCallback< ChatActionTopicResponse > callback )
inline

Create a group topic It can be used to let multiple users connect to each other.

Parameters
groupNamegroup chat name
adminUserIdlist of moderator/admin for this group chat
memberUserIdslist of members for this group chat
callbackResult of this operation

◆ CreatePersonalTopic()

void AccelByte.Api.Chat.CreatePersonalTopic ( string otherUserId,
ResultCallback< ChatActionTopicResponse > callback )
inline

Create a private topic with other user.

Parameters
otherUserIdother user we want to create a topic with.
callbackResult of this operation.

◆ DeleteGroupChat()

void AccelByte.Api.Chat.DeleteGroupChat ( string groupId,
string chatId,
ResultCallback callback )
inline

Delete a message from group chat (used by group moderator).

Parameters
groupIdId of group from group service.
chatIdId of message to delete.
callbackFunction callback when operation is done.

◆ DeleteSystemMessages()

void AccelByte.Api.Chat.DeleteSystemMessages ( HashSet< string > messageIds,
ResultCallback< DeleteSystemMessagesResponse > callback )
inline

Delete system message(s) in user system inbox.

Parameters
messageIdsArray of system message id
callbackFunction callback when operation is done.

◆ DeleteTopic()

void AccelByte.Api.Chat.DeleteTopic ( string topicId,
ResultCallback< ChatActionTopicResponse > callback )
inline

Delete a topic.

Parameters
topicIdtopic id to be deleted
callbackResult of this operation

◆ GetGroupChatSnapshot()

void AccelByte.Api.Chat.GetGroupChatSnapshot ( string groupId,
string chatId,
ResultCallback< ChatSnapshotResponse > callback )
inline

Get chat snapshot (used by group moderator).

Parameters
groupIdId of group from group service.
chatIdId of message.
callbackFunction callback when operation is done.

◆ GetSystemMessagesStats()

void AccelByte.Api.Chat.GetSystemMessagesStats ( ResultCallback< GetSystemMessageStatsResponse > callback,
GetSystemMessageStatsRequest request = default )
inline

Get system messages stats.

Parameters
callbackFunction callback when operation is done.
requestOptional request parameter

◆ GetUserChatConfiguration()

void AccelByte.Api.Chat.GetUserChatConfiguration ( ResultCallback< GetUserChatConfigurationResponse > callback)
inline

Get chat configuration for current user.

Parameters
callbackCallback for retrieved chat configuration or error

◆ JoinTopic()

void AccelByte.Api.Chat.JoinTopic ( string topicId,
ResultCallback< ChatActionTopicResponse > callback )
inline

Join a specific topic id.

Parameters
topicIdtopic id to be joined
callbackResult of this operation

◆ MuteGroupUserChat()

void AccelByte.Api.Chat.MuteGroupUserChat ( string groupId,
string userId,
int durationInSeconds,
ResultCallback callback )
inline

Mute user from group chat (used by group moderator).

Parameters
groupIdId of group from group service.
userIdId of the user to be muted.
durationInSecondsDuration of mute in seconds.
callbackFunction callback when operation is done.

◆ QueryChat()

void AccelByte.Api.Chat.QueryChat ( string topicId,
ResultCallback< QueryChatResponse > callback,
int limit = 20,
DateTime lastChatCreatedAt = default(DateTime) )
inline

Query chat messages within a topic.

Parameters
topicIdTopic ID to query.
callbackFunction callback when operation is done.
limitMax returned data count.
lastChatCreatedAtOldest message date to fetch.

◆ QueryGroupTopic()

void AccelByte.Api.Chat.QueryGroupTopic ( string keyword,
ResultCallback< QueryTopicResponse > callback,
int offset = 0,
int limit = 20 )
inline

Query group topics that user is currently a part of.

Parameters
keywordTopic name keyword to filter.
callbackFunction callback when operation is done.
offsetPage offset based on limit number, start from 0. (ex. offset 1 with limit 20 will give item number 21-40)
limitCount limit of item returned in one request.

◆ QueryPersonalTopic()

void AccelByte.Api.Chat.QueryPersonalTopic ( string keyword,
ResultCallback< QueryTopicResponse > callback,
int offset = 0,
int limit = 20 )
inline

Query personal topics that user is currently a part of.

Parameters
keywordTopic name keyword to filter.
callbackFunction callback when operation is done.
offsetPage offset based on limit number, start from 0. (ex. offset 1 with limit 20 will give item number 21-40)
limitCount limit of item returned in one request.

◆ QuerySystemMessage()

void AccelByte.Api.Chat.QuerySystemMessage ( ResultCallback< QuerySystemMessagesResponse > callback,
QuerySystemMessageRequest request = default )
inline

Query system messages in user's system inbox.

Parameters
callbackFunction callback when operation is done.
requestOptional request parameter

◆ QueryTopic() [1/2]

void AccelByte.Api.Chat.QueryTopic ( string keyword,
ResultCallback< QueryTopicResponse > callback,
int offset = 0,
int limit = 20 )
inline

Query group and personal topics that user is currently a part of.

Parameters
keywordTopic name keyword to filter.
callbackFunction callback when operation is done.
offsetPage offset based on limit number, start from 0. (ex. offset 1 with limit 20 will give item number 21-40)
limitCount limit of item returned in one request.

◆ QueryTopic() [2/2]

void AccelByte.Api.Chat.QueryTopic ( string topicId,
ResultCallback< QueryTopicByIdResponse > callback )
inline

Query group and personal topic by topic ID.

Parameters
topicIdTopic ID to search.
callbackFunction callback when operation is done.

◆ RefreshToken()

void AccelByte.Api.Chat.RefreshToken ( string newToken,
ResultCallback callback )
inline

Send a new access token to be used in chat service.

Parameters
newTokenThe new token to be used.
callbackResult of this operation.

◆ SendChatMessage()

void AccelByte.Api.Chat.SendChatMessage ( string topicId,
string message,
ResultCallback< SendChatResponse > callback )
inline

Send chat message to a topic.

Parameters
topicIdID of the topic.
messageChat message to send.
callbackFunction callback when operation is done.

◆ SetUserChatConfiguration()

void AccelByte.Api.Chat.SetUserChatConfiguration ( bool isProfanityDisabled,
ResultCallback< SetUserChatConfigurationResponse > callback )
inline

Set chat configuration for current user.

Parameters
isProfanityDisabledBool config for profanity filter
callbackCallback for successful processing or error

◆ UnbanGroupUserChat()

void AccelByte.Api.Chat.UnbanGroupUserChat ( string groupId,
List< string > userIds,
ResultCallback< UnbanGroupChatResponse > callback )
inline

Unban users from group chat (used by group moderator).

Parameters
groupIdId of group from group service.
userIdsList of user ids to ban.
callbackFunction callback when operation is done.

◆ UnblockUser()

void AccelByte.Api.Chat.UnblockUser ( string userId,
ResultCallback< BlockUnblockResponse > callback )
inline

Unblock user.

Parameters
userIduser ID to unblock.
callbackFunction callback when operation is done.

◆ UnmuteGroupUserChat()

void AccelByte.Api.Chat.UnmuteGroupUserChat ( string groupId,
string userId,
ResultCallback callback )
inline

Unmute user from group chat (used by group moderator).

Parameters
groupIdId of group from group service.
userIdId of the user to be muted.
callbackFunction callback when operation is done.

◆ UpdateSystemMessages()

void AccelByte.Api.Chat.UpdateSystemMessages ( HashSet< ActionUpdateSystemMessage > actionUpdateSystemMessages,
ResultCallback< UpdateSystemMessagesResponse > callback )
inline

Update system message(s) in user system inbox.

Parameters
actionUpdateSystemMessagesArray of ActionUpdateSystemMessage containing action to mark read/unread and keep system messages.
callbackFunction callback when operation is done.