📜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:

... WITH amount >= 10 ON Donation ... ON Donation amount >= 10 amount <= 20 ... ON Donation WITH amount >= 10 WITH amount <= 20

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:

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the donation

15.0

currency / donation_currency

Currency of the donation

USD

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

Streamlabs

StreamElements

Supported by

Event: JustGiving Donation

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the donation

15.0

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

Streamlabs

StreamElements

Supported by

Event: ExtraLife Donation

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the donation

15.0

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

Streamlabs

StreamElements

Supported by

Event: Patreon Pledge

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the pledge

15.0

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

Streamlabs

StreamElements

Supported by

Event: Tiltify Donation

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the pledge

15.0

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

Streamlabs

StreamElements

Supported by

Event: TreatStream Treat

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

title

Title of the Treat

My Treat

amount / donation_amount

Amount of the pledge

15.0

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

Streamlabs

StreamElements

Supported by

Event: Loyalty Point Redemption

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

title

Title of the Redemption item

My Redemption Item

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

Streamlabs

StreamElements

Supported by

Event: Twitch Channel Point Reward

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor, if any

Lorem ipsum dolor

title

Title of the Reward. (Case-sensitive)

My Test Reward

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

Streamlabs

StreamElements

Supported by

Event: Twitch Chat Message

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Hello World!

months / month_count / subscription_months

How many months did the actor is subscribed for. 0 if they are not a subscriber

0

badges / chat_badges

A list of the badges owned by the actor

["moderator", "vip", "broadcaster"]

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

Streamlabs

StreamElements

Supported by

📕pageChat

Event: Twitch Follow

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

example
...
 ON Twitch Follow

Streamlabs

StreamElements

Supported by

Event: Twitch Subscription Gift

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

amount

Count of subscription gifts

3

tier / subscription_tier

Tier of subscription (Classical 1, 2, 3 or 0 for Prime)

2

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

Streamlabs

StreamElements

Supported by

Event: Twitch Subscription

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

months / month_count / subscription_months

Count of subscription months

3

tier / subscription_tier

Tier of subscription (Classical 1, 2, 3 or 0 for Prime)

2

gifted

Indicarted whether this subscription is gifted or not

true or false

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

Streamlabs

StreamElements

Supported by

Event: Twitch Host

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

viewers / viewer_count

Count of viewers

100

example
...
 ON Twitch Host
 WITH viewer_count > 500

Streamlabs

StreamElements

Supported by

Event: Twitch Raid

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

raiders / raider_count

Count of raiders

200

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

Streamlabs

StreamElements

Supported by

Event: Twitch Bits

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

Predicate Property

Property Description

Exemplar Value

actor

Actor of the event

iGoodie

message

Message of the actor

Lorem ipsum dolor

amount / donation_amount

Amount of the donation

1500

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

Streamlabs

StreamElements

Supported by

Event: Youtube Subscription

Event: Youtube Sponsor

Event: Youtube Superchat

Event: Mixer Follow

Event: Mixer Subscription

Event: Mixer Host

Last updated