# OnChatRegistered

<table data-full-width="false"><thead><tr><th width="254">Parameters</th><th></th></tr></thead><tbody><tr><td>ChatInformation</td><td>The information about the chat that was registered.</td></tr></tbody></table>

{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```csharp
using UnityEngine;
using TankAndHealerStudioAssets;

public class ChatBoxExample : MonoBehaviour
{
	// BE SURE TO ASSIGN THIS IN THE INSPECTOR //
	public UltimateChatBox chatBox;


	void Start ()
	{
		chatBox.OnChatRegistered += ( chatInfo ) =>
   		{
                	print( $"Chat was registered from user: {chatInfo.Username} with this content: {chatInfo.Message}" );
		};
		
		// OR //
		
		chatBox.OnChatRegistered += OnChatRegistered;
	}
	
	void OnChatRegistered ( UltimateChatBox.ChatInformation chatInfo )
	{
		print( $"This also works! Chat registered from user: {chatInfo.Username} with content: {chatInfo.Message}" );
	}
}
```

{% endcode %}
