Twitch

Twitch

Outgoing channel : TWITCH

About

This extension provides triggers/actions for twitch to allow things like changing of title/category to banning users ect

Triggers/Actions

Triggers and actions below are updated when the automatic document generation system is run and only contain triggers actions relating to this specific extension.

Table last updated: Wed, 12 Mar 2025 05:38:02 GMT

Triggers

name trigger description
UserBanned trigger_TwitchUserBanned A user was banned
CharityCampaignProgress trigger_TwitchCharityCampaignProgress Progress of a charity Campaign
CharityCampaignStart trigger_TwitchCharityCampaignStart Start of a charity campaign
CharityCampaignStop trigger_TwitchCharityCampaignStop Charity campaign stopped
CharityDonation trigger_TwitchCharityDonation Charity Donation
Cheer trigger_TwitchCheer Someone donated some bits
Follow trigger_TwitchFollow Someone Followed
GoalBegin trigger_TwitchGoalBegin A stream goal began
GoalEnd trigger_TwitchGoalEnd A stream goal Ended
GoalProgress trigger_TwitchGoalProgress A stream goal Progress
HypeTrainBegin trigger_TwitchHypeTrainBegin A Hype Train Started
HypeTrainEnd trigger_TwitchHypeTrainEnd A Hype Train Ended
HypeTrainProgress trigger_TwitchHypeTrainProgress A hypeTrain is in progress
ModAdded trigger_TwitchModAdded A User was added to the Mod list
ModRemoved trigger_TwitchModRemoved A User was removed to the Mod list
PollBegin trigger_TwitchPollBegin A Poll Started
PollEnd trigger_TwitchPollEnd A Poll Ended
PollProgress trigger_TwitchPollProgress A Poll Progressed
PredictionBegin trigger_TwitchPredictionBegin A Prediction Began
Prediction trigger_TwitchPrediction A Prediction
PredictionEnd trigger_TwitchPredictionEnd A Prediction Ended
PredictionLock trigger_TwitchPredictionLock A Prediction Locked
PredictionProgress trigger_TwitchPredictionProgress A Prediction Progressed
RaidFrom trigger_TwitchRaidFrom Another streamer raided the channel
RaidTo trigger_TwitchRaidTo A raid was started
RedemptionAdd trigger_TwitchRedemptionAdd A user used channel points for a redemption
RedemptionUpdate trigger_TwitchRedemptionUpdate A user used channel points for a redemption update??
RewardAdd trigger_TwitchRewardAdd Reward added by streamer to channel
RewardRemove trigger_TwitchRewardRemove Reward removed by streamer to channel
RewardUpdate trigger_TwitchRewardUpdate Reward updated by streamer to channel
ShieldModeBegin trigger_TwitchShieldModeBegin Shield mode was started
ShieldModeEnd trigger_TwitchShieldModeEnd Shield mode was ended
ShoutoutSent trigger_TwitchShoutoutCreate A shoutout was performed by the streamer
ShoutoutReceive trigger_TwitchShoutoutReceive A shoutout was received for the streamer
Subscription trigger_TwitchSubscription Someone subscribed
SubscriptionEnd trigger_TwitchSubscriptionEnd Someone subscription ended
SubscriptionGift trigger_TwitchSubscriptionGift Someone gifted a subscription
SubscriptionMessage trigger_TwitchSubscriptionMessage Announcement of a channel subscription by the subscriber
UserUnBanned trigger_TwitchUserUnBanned A user was unbanned
TitleChanged trigger_TwitchTitleChanged The Stream title was changed
GamedChanged trigger_TwitchGamedChanged The Game was changed
StreamIdChanged trigger_TwitchStreamIdChanged The stream ID has changed
StreamLanguageChanged trigger_TwitchStreamLanguageChanged The stream language has changed
StreamerNameChanged trigger_TwitchStreamerNameChanged The streamer name has changed
StreamStarted trigger_TwitchStreamStarted The Stream Started
StreamEnded trigger_TwitchStreamEnded The Stream Ended
CommercialStarted trigger_TwitchCommercialStarted A Commercial was started
VIPAdded trigger_TwitchVIPAdded A User was added to the VIP list
VIPRemoved trigger_TwitchVIPRemoved A User was removed to the VIP list
Editors trigger_TwitchEditors A list of editors for the channel
VIPs trigger_TwitchVIPs A list of VIPs for the channel
FollowerCount trigger_TwitchFollowerCount Follower count
FollowedChannels trigger_TwitchFollowedChannels Followed channels
CheerEmotes trigger_TwitchCheerEmotes Cheer emotes
Leaderboard trigger_TwitchLeaderboard Bits leaderboard
Poll trigger_TwitchPoll A poll
UserBlocks trigger_TwitchUserBlocks Who this user has blocked
ClipCreated trigger_TwitchClipCreated A twitch clip
VodClip trigger_TwitchVodClip A twitch vod clip
UserDetails trigger_TwitchUserDetails Twitch User Data
GameCategories trigger_TwitchGameCategories Updated list of games

Actions

name trigger description
ChangeTitle action_TwitchChangeTitle Change channel title
StartCommercial action_TwitchStartCommercial Start a Commercial for (30, 60, 90, 120, 150, 180) seconds
GetEditors action_TwitchGetEditors Get a list of editors for the channel
GetVIPs action_TwitchGetVIPs Get a list of VIPs for the channel
AddVIP action_TwitchAddVIP Promote user to VIP
RemoveVIP action_TwitchRemoveVIP Demote user from VIP
AddMod action_TwitchAddMod Promote user to Mod
RemoveMod action_TwitchRemoveMod Demote user from Mod
Ban action_TwitchBan Bans a user from the stream
Unban action_TwitchUnban Unbans a user from the stream
FollowerCount action_TwitchFollowerCount Get follower count
FollowedChannels action_TwitchFollowedChannels Get followed channels
CheerEmotes action_TwitchCheerEmotes Get cheer emotes
Leaderboard action_TwitchLeaderboard Get bits leaderboard
GetPolls action_TwitchGetPolls Gets a list of polls
GetPoll action_TwitchGetPoll Get a poll
CreatePoll action_TwitchCreatePoll Create a poll
EndPoll action_TwitchEndPoll End a poll
StartPrediction action_TwitchStartPrediction Start a prediction
CancelPrediction action_TwitchCancelPrediction Cancel a prediction
GetPredictions action_TwitchGetPredictions Gets a list of predictions
GetPrediction action_TwitchGetPrediction Get a prediction
LockPrediction action_TwitchLockPrediction Lock a prediction
RemovePrediction action_TwitchLRemovePrediction Remove a prediction
ResolvePrediction action_TwitchLResolvePrediction Resolve a prediction
CreateUserBlock action_TwitchCreateBlock Block a user
DeleteUserBlock action_TwitchDeleteBlock Unblock a user
GetUser action_TwitchGetUser Gets a Users Details
GetBlocks action_TwitchGetBlocks Get a list of blocked users
CreateClip action_TwitchCreateClip Create a twitch clip
GetClipById action_TwitchGetClipById Get clip by id
GetClipsForBroadcaster action_TwitchGetClipsForBroadcaster Get clips for a broadcaster
GetClipsForGame action_TwitchGetClipsForGame Get clips for a game
TwitchGameCategories action_GetTwitchGameCategories Get the list of games
TwitchGetStats action_GetTwitchStats Return will be a set of triggers for current game etc

"Twitch" Extension Details...

Connection to the Twitch pub/sub api. Allows full admin access over your streaming acccount from banning users, setting stream titles to more complex features like vods, clips etc.
Source:

Methods

ConnectToDataCenter(host, port)

Connects to the StreamRoller server
Parameters:
Name Type Description
host string
port number
Source:

SaveConfigToServer()

Save our config to the server
Source:

SendCredentialsModal(extensionname)

Send our CredentialsModal to whoever requested it
Parameters:
Name Type Description
extensionname string
Source:

SendSettingsWidgetSmall(toChannel)

Send our small settings widget html code to the given extension
Parameters:
Name Type Description
toChannel string
Source:

(async) addGameToHistoryFromGameName(gameName)

Adds a game by name to the history list
Parameters:
Name Type Description
gameName string
Source:

(async) addMod(username)

make username a mod
Parameters:
Name Type Description
username string
Source:

(async) addVIP(username)

Make the username a VIP
Parameters:
Name Type Description
username string
Source:

(async) banUser(username, reason)

Ban username for given reason
Parameters:
Name Type Description
username string
reason string
Source:

(async) cancelPrediction(data)

Cancels a prediction
Parameters:
Name Type Description
data object
Source:

(async) cheerEmotes()

send trigger_TwitchCheerEmotes
Source:

(async) connectTwitch()

Connects to the twitch api
Source:

containsBadChars(s)

Tests for unicode charts in a string
Parameters:
Name Type Description
s string
Source:
Returns:
boolean

(async) createBlock(data)

Block the user given
Parameters:
Name Type Description
data object
Source:

(async) createClip()

Create a twitch clip and send out trigger_TwitchClipCreated when done
Source:

createDropdownWithSearchableHistory(id, categories, history, currentSelectedId)

Creates an html dropdown list that is searchable using the given information
Parameters:
Name Type Description
id string
categories string
history string
currentSelectedId string
Source:
Returns:
html string containing dropdown code

(async) createPoll(data)

Creates a twitch poll
Parameters:
Name Type Description
data object
Source:

createPredictionString(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

(async) deleteBlock(data)

Remove a Block from the given user
Parameters:
Name Type Description
data object
Source:

disconnectTwitch()

Disconnect the twitch API
Source:

(async) endPoll(data)

Ends the given poll
Parameters:
Name Type Description
data object
Source:

findTriggerByMessageType(messagetype)

Find a trigger by message type
Parameters:
Name Type Description
messagetype string
Source:
Returns:
trigger

findTriggerByMessageType(messagetype)

Finds the trigger using the passed messagetype
Parameters:
Name Type Description
messagetype string
Source:
Returns:
trigger

(async) followedChannels()

sends trigger_TwitchFollowedChannels
Source:

(async) followerCount()

Send trigger_TwitchFollowerCount
Source:

(async) getAllGameCategories(id)

Collates and sends out the twitch 'Top' category list
Parameters:
Name Type Default Description
id string twitch trigger identifier or "twitch"
Source:

(async) getBlockedUsers()

send a trigger_TwitchUserBlocks message containing current blocked users
Source:

(async) getChannelEditors()

sends trigger trigger_TwitchEditors containing the chat editors
Source:

(async) getChannelVIPs()

send trigger_TwitchVIPs containing chat VIP's
Source:

(async) getClipById(data, rollbackCountopt)

Gets a clip using data.clipName,if clip isn't available yet (i.e. still being processed) setup a reschedule timer to wait for clip. Sends trigger_TwitchVodClip when found
Parameters:
Name Type Attributes Default Description
data object
rollbackCount number <optional>
5 in seconds, reduced by 1 second each rollback
Source:

(async) getClipsByBroadcaster(data, rollbackCountopt)

Sends out a trigger_TwitchVodClip message for each clip the broadcaster has data is formatted from an action.
Parameters:
Name Type Attributes Default Description
data object
rollbackCount number <optional>
5 number of times to check (1 second polls, in case clip is still being processed)
Source:

(async) getClipsByGame(data)

sends a trigger_TwitchVodClip for each clip from a game category based on data object
Parameters:
Name Type Description
data object
Source:

(async) getGameFromId(gameId)

Get a game object from a game Id
Parameters:
Name Type Description
gameId number
Source:
Returns:
gameobject

(async) getPoll(id)

send trigger_TwitchPoll
Parameters:
Name Type Description
id number
Source:

(async) getPolls()

send a trigger_TwitchPoll message for each poll running
Source:

(async) getPrediction(data)

Sends trigger_TwitchPrediction for the given prediction
Parameters:
Name Type Description
data object
Source:

(async) getPredictions(data)

sends trigger_TwitchPrediction for each current predictions
Parameters:
Name Type Description
data object
Source:

getTextboxWithHistoryHTML(SelectEleId, TextEleId, history, currentSelectedId)

Creates an html dropdown list on a text box is searchable using the given information
Parameters:
Name Type Description
SelectEleId string
TextEleId string
history string
currentSelectedId string
Source:
Returns:
html string containing textbox code

(async) getUser(username)

send trigger_TwitchUserDetails message for given user
Parameters:
Name Type Description
username string
Source:

handleSettingsWidgetSmallData(modalCode)

Handles data from a user submit on our small settings widget
Parameters:
Name Type Description
modalCode object
Source:
Returns:
boolean restart connection needed due to data change

heartBeatCallback()

Sends out heartbeat messages so other extensions can see our status
Source:

init(LocalConfig, ServerConfig, tAndAs, triggerCAllback)

Initialises the pub sub module with the given data
Parameters:
Name Type Description
LocalConfig object
ServerConfig object
tAndAs object
triggerCAllback function
Source:

initialise(app, host, port, heartbeat)

Starts the extension using the given data.
Parameters:
Name Type Description
app object:Express
host string
port number
heartbeat number
Source:

(async) leaderboard()

send trigger_TwitchLeaderboard
Source:

(async) lockPrediction(data)

Locks a prediction in it's current state
Parameters:
Name Type Description
data object
Source:

onChannelBan(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelCharityCampaignProgress(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelCharityCampaignStart(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelCharityCampaignStop(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelCharityDonation(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelCheer(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelFollow(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelGoalBegin(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelGoalEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelGoalProgress(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelHypeTrainBegin(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelHypeTrainEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelHypeTrainProgress(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelModeratorAdd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelModeratorRemove(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPollBegin(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPollEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPollProgress(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPredictionBegin(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPredictionEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPredictionLock(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelPredictionProgress(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRaidFrom(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRaidTo(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRedemptionAdd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRedemptionUpdate(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRewardAdd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRewardRemove(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelRewardUpdate(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelShieldModeBegin(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelShieldModeEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelShoutoutCreate(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelShoutoutReceive(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelSubscription(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelSubscriptionEnd(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelSubscriptionGift(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelSubscriptionMessage(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onChannelUnban(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

(async) onChannelUpdate(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onDataCenterConnect(socket)

called on StreamRoller websocket connect
Parameters:
Name Type Description
socket object
Source:

onDataCenterDisconnect(reason)

called on StreamRoller websocket disconnect
Parameters:
Name Type Description
reason string
Source:

onDataCenterMessage(server_packet)

Called when we receive a StreamRoller message
Parameters:
Name Type Description
server_packet object
Source:

onStreamOffline(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

onStreamOnline(data)

Fires on a twitch pubsub event
Parameters:
Name Type Description
data object
Source:

pubSubTriggerCallback(trigger)

Callback for all triggers used in the twitch pubsub. gets called whenever the pubsub module needs to create a trigger
Parameters:
Name Type Description
trigger object
Source:

registerSubs(streamerId)

register all subs for the given streamerId stream
Parameters:
Name Type Description
streamerId string
Source:

(async) removeMod(username)

Remove mod status from username
Parameters:
Name Type Description
username string
Source:

(async) removePrediction(data)

Delete prediction
Parameters:
Name Type Description
data object
Source:

removeSubs()

remove all sub events
Source:

(async) removeVIP(username)

Remove VIP status from user
Parameters:
Name Type Description
username string
Source:

(async) resolvePrediction(data)

Resolves the current prediction with the given data
Parameters:
Name Type Description
data object
Source:

sendCurrentGameData(triggerIdopt)

sends trigger_TwitchGamedChanged
Parameters:
Name Type Attributes Default Description
triggerId number <optional>
"twitch" ref id from action
Source:

sendGameCategoriesTrigger(idopt)

sends trigger_TwitchGameCategories containing all games in our category
Parameters:
Name Type Attributes Default Description
id number <optional>
"twitch" ref id from action
Source:

sendTrigger(trigger)

sends out the given trigger
Parameters:
Name Type Description
trigger object
Source:

sendTrigger(trigger)

Sends the given trigger out on our channel
Parameters:
Name Type Description
trigger object
Source:

(async) setStreamGame(gameId)

Sets the current game/category in twitch
Parameters:
Name Type Description
gameId number
Source:

(async) setStreamTitle(title)

Sets the current stream title
Parameters:
Name Type Description
title string
Source:

start(host, port, nonce, clientId, heartbeat)

Starts the extension using the given data.
Parameters:
Name Type Description
host string
port number
nonce number
clientId number
heartbeat number
Source:

(async) startCommercial(length)

Start a add/commercial running on twitch
Parameters:
Name Type Description
length number ["30", "60", "90", "120", "150", "180"]
Source:

(async) startEventSub(streamerId, apiClient, channelData)

Starts event pub subs registration
Parameters:
Name Type Description
streamerId string
apiClient object
channelData object
Source:

(async) startPrediction(data)

Starts a prediction
Parameters:
Name Type Description
data object
Source:

(async) unbanUser(username, reason)

Unban username for give reason
Parameters:
Name Type Description
username string
reason string
Source: