> For the complete documentation index, see [llms.txt](https://docs.streamavatars.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.streamavatars.com/lua-scripting-api/api-reference-and-tips/events/read-chat.md).

# Read Chat

```lua
function yourEvent(user, string_message)
    log(user.displayName .. ' has said ' .. string_message);
end

return function()
    addEvent('chatMessage', 'yourEvent'); --attaches the event to yourEvent()
    keepAlive();
end
```

{% hint style="info" %}
Events are asynchronous coroutines.
{% endhint %}
