# Events

## Overview
Events are a special type of command that is triggered by things happening on your connected services rather than by you or your viewers directly, such as receiving a chat message, a new follower, or a subscription. When a service reports that something happened, Mix It Up runs the actions you have set up for that event.

An event does nothing until you set it up by clicking its Add Command button and filling in actions. Enabling, disabling, and testing only work once that command exists. After it does, you can enable or disable the event with the circular sliding button, test it with the Play button, and change it with the Edit button.

Some events have a delay on them for one or more reasons. In almost all cases, these delays are out of our hands and are based on the way the service we are interacting with has designed things.

For donation/tipping events, the timing relies on the individual service and what it provides access to. Any services that have a way to get real-time events will be done in real-time. Services that do not have real-time events will have a delay on them as we periodically check for new donations/tips.

> Some events are designed to only be triggered once per-launch of Mix It Up as both a safeguard and preventative mechanism. These once-per-launch events correspond to things that would only be expected to occur once-per-stream. Some of these include stream start, stream stop, per-user follows, and per-user raids. By comparison, events related to things like gifted subscriptions or donations can be triggered any number of times because they are things that can occur multiple times in a stream and multiple times per person. It is expected that Mix It Up be shut down when not in use for streaming or editing, as events and other features are designed around the idea of once-per-launch. Any events that are only triggerable once per-launch or once per-user, per-launch will have a note indicating as such.

The events listed below are the generic, cross-platform events available in Mix It Up. Events that are specific to a platform or service, such as Twitch channel point redemptions or donations from a tipping service, can be found on that platform or service's individual page. Events that trigger from chat activity are listed on the [Chat](/docs/chat) page.

## Generic

Generic events are a way to centralize your events across multiple platforms. These events will trigger if any individual platform has a similar event that would trigger (EX: The Twitch Channel Followed event will also trigger the Generic Channel Followed event). Generic events will **only** trigger if there is a corresponding event of the same type for that specific platform. For each generic event below, the list of supported platforms is noted next to the name.

### Application Launch
This event will run immediately after Mix It Up is launched and logged into the current account. This can be used for setting up certain things for your stream prior to it actually starting (EX: Launching an application, setting Special Identifiers, etc). This event is only triggered once per-application launch.

### Application Exit
This event will run as Mix It Up is being shut down from the current account. This can be used for cleaning up anything related to using Mix It Up. This event is only triggered once per-application launch.

### Channel Stream Start
*Twitch, YouTube, Kick, Velora*

This event will run when your stream goes from offline to online. It is often used to send out Discord and social media notices to alert users that your stream is starting. This event is only triggered once per-application launch.

This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on

### Channel Stream Stop
*Twitch, YouTube, Kick, Velora*

This event will run when your stream goes from online to offline. It is often used to send out Discord and social media notices to alert users that your stream has ended. This event is only triggered once per-application launch.

This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on

### Channel Followed
*Twitch, Kick, Velora*

This event will run the first time a user follows during this specific session of Mix It Up. This means that if a user follows, unfollows, and then re-follows quickly, it will only run the first time. This event is only triggered once per-user, per-application launch.

The [User](/docs/reference/special-identifiers#user) special identifiers indicate the user that followed. This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on

### Channel Raided
*Twitch, Velora*

This event triggers when a channel raids your channel. It is often used to thank the user for the raid using chat and possibly overlay. This event is only triggered once per-user, per-application launch.

The [User](/docs/reference/special-identifiers#user) special identifiers indicate the user that raided. This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on
- $raidviewercount = The number of viewers of the channel that raided (EX: 10)

### Channel Subscribed
*Twitch, YouTube, Kick, Velora*

This event will run when a user subscribes to your channel. This event is only triggered once per-user, per-application launch.

In addition to regular [User](/docs/reference/special-identifiers#user) Special Identifiers, this event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on
- $message = An optional message that the user can supply when subscribing
- $usersubplan = The tier of the plan (Prime/Tier 1/Tier 2/Tier 3)

### Channel Resubscribed
*Twitch, YouTube, Kick, Velora*

This event will run when a user resubscribes to your channel. This event is only triggered once per-user, per-application launch.

In addition to regular [User](/docs/reference/special-identifiers#user) Special Identifiers, this event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on
- $usersubplan = The tier of the plan (Prime/Tier 1/Tier 2/Tier 3)
- $usersubplanname = The specialized name you have set for that tier of subscription
- $message = An optional message that the user can supply when resubscribing

### Channel Subscription Gifted
*Twitch, YouTube, Kick, Velora*

This event will run for every user that is gifted a subscription by another user in your channel. The [User](/docs/reference/special-identifiers#user) Special Identifiers reference the user that GIFTED the subscription (Ex: $username), while the [Target User](/docs/reference/special-identifiers#target-user) Special Identifiers reference the user that RECEIVED the subscription (Ex: $targetusername). This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on
- $isanonymous = Whether the sub gifting was done anonymously (EX: true/false)

### Channel Mass Subscriptions Gifted
*Twitch, YouTube, Kick, Velora*

This event will run once for each time a user in your channel gifts a **set** of subscriptions. This is when a user selects a number of subs to gift all at once to users in the channel. For example, if a user gifts 5 subscriptions to your channel, this event will be run once, while the [Channel Subscription Gifted](/docs/events#channel-subscription-gifted) will be run 5 times, once for each user. The [User](/docs/reference/special-identifiers#user) Special Identifiers reference the user that GIFTED the subscription.

Whether this command or the Channel Subscription Gifted command runs is based on what is set for the Mass Gifted Subscriptions Filter Amount under Settings -> Commands. This option is designed to help reduce the spam of subscription gifted commands and provide a better experience for your stream. For example, if this option is enabled and the amount is set to 5, then any time 5 OR LESS subscriptions are gifted at once, it will ONLY run the regular Subscription Gifted event for each subscription. If MORE THAN 5 are gifted, then it will ONLY run the Mass Subscriptions Gifted event once. Note that this will cause the processing of Subscription Gifted & Mass Subscription Gifted events to be slightly delayed, typically less than 10 seconds.

This event provides the following additional Special Identifiers:
- $streamingplatform = The name of the platform the event occurred on
- $subsgiftedamount = The number of subscriptions gifted for this specific instance
- $isanonymous = Whether the sub gifting was done anonymously (EX: true/false)
