Triggers

Overview of trigger configuration in Streamer.bot

The release of Streamer.bot 0.2.0 included a large overhaul to the events system, with the introduction of Triggers.

You now have more control over events and their execution through Trigger configuration options, and events can now trigger more than one action.

Triggers also introduced the ability to easily test your actions!

To activate the triggers pane, you must first select an action by clicking on it in the main actions pane.

Right-Click anywhere in the triggers pane (or click the + icon in the top right) to browse triggers and add them to your selected action.

Explore all available triggers and their configuration options in the Triggers API References

You will notice several core types of configuration options when setting up your triggers, outlined below:

These triggers require no additional configuration.

For example, the Streamer.bot Started Trigger always executes on initial startup of Streamer.bot with no additional configuration needed.

Checkbox configuration can be used to filter incoming triggers based on multiple event types, which can be toggled on or off.

Checkbox Trigger Configuration

For example, the Twitch Subscription Trigger allows you to toggle incoming trigger events for each subscription tier.

Dropdown configuration can be used to filter incoming triggers based on preexisting values.

Dropdown Trigger Configuration

For example, the Command Cooldown Trigger allows you to filter incoming trigger events for specific commands.

These triggers also include the option Any, which allows events to trigger on any of the included options.

Range configuration is used for filtering incoming numeric triggers based on minimum and maximum values.

Range Trigger Configuration

For example, the Twitch Cheer Trigger allows you to filter incoming trigger events for a specified bit range.

Min and Max values are inclusive
If only a Max is set, the trigger will execute on exact values matching the configured Max

Leave both Min and Max blank to trigger on all values.

Learn about the Always Run option for range triggers below

Text field configuration can be used to filter incoming triggers based on arbitrary text values.

Text Box Trigger Configuration

For example, the Global Variable Updated Trigger allows you to filter incoming trigger events based on a specified variable name.

This field can be left empty to trigger on all values.

Right-Click any existing trigger to reveal additional context menu options:

Send a test execution of the selected trigger

Read more about Testing Actions below

Open the configuration dialog for the selected trigger

Copy the selected trigger to the clipboard

This creates a Base64 string intended to be pasted into other actions, but it can also be sent to notepad or any other computer to be imported into another instance of Streamer.bot

Paste a copied trigger into the selected action

Delete the selected trigger

This will show a confirmation dialog by default

Toggle this trigger on or off.

Reload criteria data for all triggers

This is useful if you have modified data elsewhere in Streamer.bot, and it is not showing up in the trigger dialog

Remove all triggers from the selected action

Enable all triggers for the selected action

Disable all triggers for the selected action

Always execute this trigger, even if another matching trigger has been configured elsewhere with an overlapping range.

This is a special option that only applies to range triggers

For example, if you have a Twitch Cheer Trigger setup to execute on any value, and another setup to execute on exactly 100 Bits:

  • Enabling Always Run will allow both triggers to execute
  • Disabling Always Run will only execute the Any trigger if the bit value does not equal 100 Bits
You can quickly recognize triggers configured to Always Run by their blue color

You can click the ? icon in the top-right of the triggers panel to open the Trigger Viewer

This window gives you a quick overview of all your configured triggers and their action mappings.

You can use triggers to easily test your actions and their behavior against various arguments.

The quickest way to execute a trigger is by selecting Test Trigger from the context menu.

For more control over variables while testing, you can use the Core > Test Trigger utility to define custom arguments, or send Simulated Events

Documentation Needed
Simulated Events documentation needed (Coming in Streamer.bot v0.2.2)
Custom Triggers require C# Code to register and execute

You can define your own triggers using C# Code. These will then show up in the trigger menu UI under Custom once the C# code defining them has been run once.

Since custom triggers need to be re-defined on every boot of StreamerBot, it is encouraged to define these in your C# module's public void Init() method and enable Precompile on Application start.

custom-triggers

// Register a new trigger labeled "Game Win" in the "Game Result" category
//                           Label         Name                 Category
CPH.RegisterCustomTrigger("Game Win", "gameResultWin", new[]{"Game Result"});

The category parameter of the RegisterCustomTrigger function always has to be an array, allowing to nest sub-categories.

This is only for user convenience and does not change the process of triggering a custom trigger by name.

custom-triggers-nested

// Register three top level triggers in category `Chat Based Poll`
CPH.RegisterCustomTrigger("Poll Ended", "poll_ended", new[] {"Chat Based Poll"});
CPH.RegisterCustomTrigger("Poll Canceled", "poll_canceled", new[] {"Chat Based Poll"});
CPH.RegisterCustomTrigger("Poll Status", "poll_status", new[] {"Chat Based Poll"});

// Register three nested triggers in category `Winner`, which is in category `Chat Based Poll`
CPH.RegisterCustomTrigger("Poll Message Winner", "poll_winner_one", new[] {"Chat Based Poll", "Winner"});
CPH.RegisterCustomTrigger("Poll Message Tie 2", "poll_winner_two", new[] {"Chat Based Poll", "Winner"});
CPH.RegisterCustomTrigger("Poll Message Tie 3", "poll_winner_three", new[] {"Chat Based Poll", "Winner"});
Read more in API > C# > Methods > Core > Triggers