📜TSL Events & Predicates

What are possible events and their predicates?

TSL events are implemented following various streaming platforms' Socket API Documents. Every event served by those APIs is accesible by TSL. As the syntax rules require, events must come after ON keyword, and predicates (if any) must be chained after WITH word(s). Predicates cannot come before event declarations, the order is strict.

Currently supported platforms:

Using invalid predicate properties will not cause any fatal error nor count as a syntax error. However, the rule might not work as expected.

(E.g using donation_amount >= 10 predicate with Twitch Follow event might cause related action not to be performed)

While writing rules which has some intersecting predicates, their order shall be considered. Only the very first rule passing all the declared predicates will be performed. For example:

DROP apple
 ON Donation
 WITH amount >= 10

DROP stick
 ON Donation
 WITH amount >= 20
 
# A donation with 20 USD will end up dropping apple
# A donation with 30 USD will also end up the same
# However a donation with 10 USD will end up dropping a stick

Event: Donation

When: Occurs when someone donates streamer. (Also refers to tips on StreamElements) Valid Predicates:

example
...
 ON Donation
 WITH amount IN RANGE [0,10]
 WITH currency = USD # Not even necessary

Event: JustGiving Donation

When: Occurs when someone donates using JustGiving integration. Valid Predicates:

example
...
 ON JustGiving Donation
 WITH amount IN RANGE [0,10]
 WITH title IS %My Redemption Item%

Event: ExtraLife Donation

When: Occurs when someone donates using ExtraLife integration. Valid Predicates:

example
...
 ON ExtraLife Donation
 WITH amount IN RANGE [0,10]

Event: Patreon Pledge

When: Occurs when someone pledges using Patreon integration. Valid Predicates:

example
...
 ON Patreon Pledge
 WITH amount IN RANGE [0,10]

Event: Tiltify Donation

When: Occurs when someone donates using Tiltify integration. Valid Predicates:

example
...
 ON Tiltify Donation
 WITH amount IN RANGE [0,10]

Event: TreatStream Treat

When: Occurs when someone treats using TreatStream integration. Valid Predicates:

example
...
 ON TreatStream Treat
 WITH title IS %My Treat%

Event: Loyalty Point Redemption

When: Occurs when someone redeems a Loyalty Point item. Valid Predicates:

example
...
 ON Loyalty Point Redemption
 WITH title IS %My Redemption Item%

Event: Twitch Channel Point Reward

When: Occurs when someone claims a Channel Points reward Valid Predicates:

example
...
 ON Twitch Channel Point Reward
 WITH title IS %My Test Reward%

Event: Twitch Chat Message

When: Occurs when someone sent a message on the chat. (See Chat page for more info) Valid Predicates:

example
...
 ON Twitch Chat Message
 WITH message PREFIX %!command%
 WITH months >= 1 # A.k.a actor is a sub
 
...
 ON Twitch Chat Message
 WITH badges CONTAINS moderator

Event: Twitch Follow

When: Occurs when someone follows streamer on Twitch. Valid Predicates:

example
...
 ON Twitch Follow

Event: Twitch Subscription Gift

When: Occurs when someone gift some amount of subscription on Twitch. Valid Predicates:

example
...
 ON Twitch Subscription Gift
 WITH amount >= 10
 WITH tier = 1 # Tier 1

Event: Twitch Subscription

When: Occurs when someone subscribes to streamer on Twitch. Valid Predicates:

example
...
 ON Twitch Subscription
 WITH months >= 10
 WITH tier = 1 # Tier 1
 # WITH tier = 0 # Tier 0 means Prime
 WITH gifted IS false # Means it should be a non-gifted sub

Event: Twitch Host

When: Occurs when someone hosts streamer on Twitch. Valid Predicates:

example
...
 ON Twitch Host
 WITH viewer_count > 500

Event: Twitch Raid

When: Occurs when someone raids streamer on Twitch. Valid Predicates:

example
...
 ON Twitch Raid
 WITH raider_count IN RANGE [0,100]

Event: Twitch Bits

When: Occurs when someone donates streamer bits on Twitch. Valid Predicates:

example
...
 ON Twitch Bits
 WITH donation_amount IN RANGE [1000,1500]

Event: Youtube Subscription

Event: Youtube Sponsor

Event: Youtube Superchat

Event: Mixer Follow

Event: Mixer Subscription

Event: Mixer Host

Last updated