> 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/platform-donation.md).

# Platform Donation

```lua
function yourEvent(user, donationInfo)
    log(user.displayName .. ' donated: ' .. donationInfo.amount_donated);
    
    
    --twitch has removed lifeTime_donated data and it is no longer available.
    --log('total bits donated: ' .. donationInfo.lifeTime_donated); 
end

return function()
    log('starting up func')
    addEvent('platformDonation', 'yourEvent'); -- attaches the event to yourEvent()
    
    keepAlive();
end
```

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