Description
Track and utilize viewer stream streaks for your Twitch streams!
Use case ideas:
- Reward users for redeeming a channel point reward multiple streams in a row
- Maintain your own stream streak tracker for user activity (chat messages, reward redemptions, cheers)
- This can serve as an alternative to Twitch’s current implementation of watch streaks which is limited to specific devices, channels, and interactions
- Allow for users to have a permanent record for their highest stream streak
This is not connected/affiliated with Twitch’s official watch streaks. This extension locally tracks when viewers interact with your stream, and manages an internal streak counter per-user. It is not in sync with Twitch’s watch streaks and will only begin tracking viewer activity when imported and enabled.
This extension is limited to Twitch streams at this time as it utilizes the Twitch API to uniquely identify streams by Twitch’s stream ID. Depending on usage and API availability, it can be expanded to serve other platforms in the future.
Import Code
StreamStreakExtension_0.1.3.sb (21.2 KB)
Installation
In Streamer.bot click the Import
button in the top menu. Drag the .sb file into the Import String
field.
Minimum Required setup
-
In Streamer.bot, go to the
Actions
tab and find the action titled[Stream Streak] [EDIT] Update User Streak
. -
Click on the action once to reveal the sub-actions for it.
-
In the
Triggers
window, there will be 3 triggers available by default. Add (or enable) the triggers that you would like to represent the user being “present” for the stream.- Default triggers:
Twitch > Channel Reward Redemption (Any)
- DisabledTwitch > Present Viewers
- DisabledCore / Test
- Enabled (this is useful for anyone looking to make custom changes and test them out)
- Each enabled trigger represents an event that will qualify as “activity” for updating a user’s stream streak.
- For example:
- If the
Present Viewers
trigger is enabled, all viewers that are present in chat will get credit for being in the stream whenever the “Present Viewers” trigger fires. By default this should happen every 5 minutes. You can read more about this trigger here. - If the
Channel Reward Redemption
trigger is enabled for all rewards, then any channel point redemption will consider the user “present” for that stream and update their streak accordingly. This is a way to allow users to possibly have their streak updated even sooner than thePresent Viewers
trigger if they are quick to redeem things upon entering the stream. This also helps in the case where a user drops in, redeems a channel point reward, and leaves before thePresent Viewers
event fires again.
- If the
- If you’re not sure where to start, it is recommended to enable both the
Twitch > Channel Reward Redemption (Any)
andTwitch > Present Viewers
triggers. This will ensure that users who are present have the best chance of getting credit for it.
- Default triggers:
This extension uses a real stream ID to keep track of stream streaks, which means it will only increment a user’s stream streak at-most once per stream, even if a user triggers it multiple times. So, if you have both of the triggers above enabled, you don’t have to worry about a user streak being updated endlessly.
Done! The above instructions are enough to:
- Track user stream streaks
- Get user stream streaks using the commands in the section at the bottom of this guide
Reminder to enable the commands after importing, as they are disabled by default.
The remaining sections are for optional features such as:
- Allowing a user to share their stream streak with the chat
- Adding streak milestones to perform an action when specific stream streaks are met
Optional Sharing User Streaks Setup
The above instructions will track user streaks and allow users to view streaks explicitly via chat command, but they will not trigger any visible events like chat messages or milestone-based stream events when updating a user’s streak. The above is to ensure streaks are properly tracked, but if you’d like to allow users to share their stream streak with an action such as a channel point reward, you can enable this too. Some examples include:
- Having a channel point reward to
Share you streak!
- Having a channel point reward to
Check in
that will also share the user’s streak upon redeeming
To enable this:
- In Streamer.bot, go to the
Actions
tab and find the action titled[Stream Streak] [EDIT] Share User Streak
. - Click on the action once to reveal the sub-actions for it.
- In the
Triggers
window, there will be 2 triggers available by default. Add (or enable) the triggers that you would like to result in a publicly visibly streak event (like a chat message, sound to play, stream effect, etc).- Default triggers:
Twitch > Channel Reward Redemption (Any)
- DisabledCore / Test
- Enabled (this is useful for anyone looking to make custom changes and test them out)
- To enable a specific channel-point reward as the trigger for sharing a streak with the stream:
- Double click on the trigger for
Twitch > Channel Reward Redemption (Any)
. - Set the reward to be the desired “Share” redemption.
- Click “Ok”.
- Right click on the
Twitch > Channel Reward Redemption (Any)
trigger and click onEnabled
to enable it.
- Double click on the trigger for
- Default triggers:
This will now allow users to redeem a Channel Point Reward to share their streak with the rest of the stream. To configure what should happen when a user shares their streak (chat message, sound playing, events on specific milestones, etc) see the following Optional
setup instructions.
Optional Auto-Chat Message Setup
You can have a message sent to chat showing a user’s streak upon redeeming a channel point reward.
- Example:
SomeUser
redeems a channel point reward for the 3rd stream in a row- Message automatically gets sent to chat with the message:
SomeUser has watched 3 streams in a row!
This is Off by default, but can be turned on by doing the following:
- Follow the instructions above under Optional Sharing User Streaks Setup. This will enable the channel point trigger.
- In Streamer.bot, go to the
Actions
tab and find the action titled[Stream Streak] [EDIT] Auto Chat Message
. Right click on this action and click on theEnabled
button to enable it.
That’s it! There is a default message that will send upon a user “sharing” their streak. If you’d like to customize the message that is sent, and perhaps perform additional sub-actions, you can do the following:
-
In the sub-actions window for this action, double click on the
Twitch Message...
sub-action and edit the message.
- Available arguments relating to stream streaks:
%userCurrentStreamStreak%
- Represents the user’s current stream streak%userMaxStreamStreak%
- Represents the user’s maximum stream streak ever%userLastStreamStreak%
- Represents the user’s last stream streak (can be useful if a user has lost their streak)
- Available arguments relating to stream streaks:
-
To add any other sub-actions, simply right click within the sub-actions window for this action and add them in there.
The automatic chat message/event will only happen once per-user per-stream. This means that if a user triggers this action multiple times in a stream, a message will only be sent the first time for that user.
For developers: you can utilize the arguments to add custom code for sending different messages depending on whether or not the user has lost their streak. One way to check for this is to see if %userCurrentStreamStreak%
is 1
and %userLastStreamStreak%
is greater than 1
.
Optional Streak Milestone Setup
You can have other actions run when a user reaches and shares a specific streak milestone. A milestone represents watching a specific number of streams in a row.
- Example:
- You create an action (not included in this extension) in Streamer.bot to make an image of confetti appear on your stream
- You add a streak milestone to trigger that action upon reaching a streak of 5 streams
- A user redeems a channel point reward for the 3rd stream in a row
- Nothing happens
- Another user redeems a channel point reward for the 5th stream in a row
- Image of confetti appears on stream
You can have different actions for different milestones.
- Some examples of what you can do:
- 5 streams in a row - send a special message to chat
- 10 streams in a row - reveal an OBS source
- 20 streams in a row - a sound plays
- etc
This is Off by default, but can be turned on by:
- Create an action in Streamer.bot for something you’d like to happen upon reaching a streak milestone.
- Follow the instructions above under Optional Sharing User Streaks Setup. This will enable the channel point trigger.
- In Streamer.bot, go to the
Actions
tab and find the action titled[Stream Streak] [EDIT] Milestones
. Right click on this action and click on theEnabled
button to enable it. - Double click on the sub-action for
if ("userCurrentStream...
to open up the editor window (default milestone with no action exists for a streak of5
)
- Set the
value
field on the 3rd row to be the milestone amount that you’d like to trigger the action. - Click on the row below for
do action
and select your resulting action from step 1. - To add more milestones, duplicate the sub-action that you just made and repeat steps 1-6.
Done!
Additional Configuration
The minimum required installation steps above are enough to get the extension working. However, the following are remaining configurations for existing/enabled functionality.
[Stream Streak] [EDIT] Get Current Streak Configuration
You can customize the message that is sent for the !streak
command. By default, the message will say something like: SomeUser has watched 6 streams in a row!
. If you’d like to change this:
- In Streamer.bot, go to the
Actions
tab and find the action titled[Stream Streak] [EDIT] Get Current Streak
. - Double click on the the
Twitch Message...
sub-action to edit the message.- Available arguments relating to stream streaks:
%targetUserName%
- Represents the target’s username- Ex 1:
!streak
will have the sender’s name - Ex 2:
!streak @someUser
will havesomeUser
’s name (@
is optional)
- Ex 1:
%userCurrentStreamStreak%
- Represents the user’s current stream streak%userMaxStreamStreak%
- Represents the user’s maximum stream streak ever%userLastStreamStreak%
- Represents the user’s last stream streak
- Available arguments relating to stream streaks:
Unlike the actions above, this command does not update the user’s streak. So, if a user enters a stream and does not yet trigger any of the above-configured actions, their stream streak will show the previously earned streak. Once the user’s streak is updated through any of the above-configured actions, this command will return the latest information.
This command is not designed to trigger any milestones or other major chat events upon reaching a streak. It is merely for a quick check. To enable milestones or chat events upon continuing a user’s streak, follow the “Optional” instructions above for Optional Sharing User Streaks Setup.
Commands
Be sure to enable the following commands after importing as they are off by default.
Command | Description | Permission |
---|---|---|
!streak | Gets the sender’s stream streak | Everyone |
!streak <targetUser> | Gets the target’s stream streak (@ is optional) |
Everyone |
!refreshstreak | Manually gets the latest stream ID from Twitch. This isn’t normally needed as the data will be retrieved from Twitch automatically based on the configured “cache” settings. | Mod |
!ignorestreak | Ignore’s the current stream for stream streaks. This will prevent the current stream ID from being counted and possibly breaking any streaks. Use this when a stream crashes and restarts, but you still want to act like the restarted stream is the same as the previous. Ex: Stream A is running for an hour and crashes. Stream B starts up moments later. Use this command to ignore stream B and continue using Stream A’s ID so any late-joiners won’t have their streaks broken. This can be undone using the !unignorestreak command. |
Mod |
!unignorestreak | Manually stops ignoring any stream that has been ignored using the !ignorestreak command. |
Mod |
!spare <targetUser> | Restores a user’s streak to their previous value. This can be done unlimited times per user and will just go back and forth between the current value and the previous one. | Mod |
!setstreak <targetUser> <streakAmount> | Sets the target’s stream streak (@ is optional). Example: !setstreak @SomeUser 10 to set SomeUser ’s streak to 10 . This will also make their existing streak be set to their last streak, allowing their original streak to be restored using the !spare command. |
Mod |