Skip to main content
Version: 5.9.6

OnRecentChatLogs

public RecentChatLogsEventHandler OnRecentChatLogs;

Argument

ValueTypeDescription
argsRecentChatLogsEventArgsInformation on recent chat history

RecentChatLogsEventArgs

ValueTypeDescription
ErrInfoErrorInfoSuccess/failure information
channelTypeChannelType(enum)Type of the channel. ChannelType.Public(normal) or ChannelType.Guild(guild)
LogInfosList< RecentChatLogsInfo >History of recently sent messages

RecentChatLogsInfo

ValueTypeDescription
NickNamestringMessage sender's nickname
MessagestringContent of the sent message

Description

It is an event called upon entering the chat channel; it is not related to the asynchronous 'load recent chat history' method.
This event is called when entering a general/guild channel.

  • Only chats from the public/guild channel are loaded; whispers, announcements, and all chat are not included.
  • Up to 30 chats can be loaded for the message history.
  • If more than 30 seconds have passed in a channel with 0 users, the log records for that channel are deleted and previous logs cannot be loaded.(This part can be supplemented through the asynchronous recent chat history retrieval method.)

In order for an event to be called, the message sending/receiving method must be called.

Example

// First way
Backend.Chat.OnRecentChatLogs = (RecentChatLogsEventArgs args) => {

Debug.Log(args.ErrInfo.ToString());
Debug.Log("Type of the entered channel : " + args.channelType.ToString());

for(int i=0;i < args.LogInfos.Count; i++)
{
Debug.Log("Nickname : " + args.LogInfos[i].NickName);
Debug.Log("Message : " + args.LogInfos[i].Message);
}
};

//Second way
Backend.Chat.OnRecentChatLogs += (args) => {
// Same logic as the first way
}