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.
  • When 30 seconds pass with no members in the channel, the log record of that channel is erased, and loading earlier logs will be unavailable.(This part can be supplemented with the asynchronous 'load recent chat history' 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());

// Prints in reverse order(oldest history at the top of the log)
for(int i=args.LogInfos.Count - 1;i >= 0; 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
}