TwitchChat

Twitch Chat

Contents

Setup

Outgoing channel : "TWITCH_CHAT"

Authorization fields

There are two sets of credentials needed. One for the user and one for the bot. Future versions will add the ability for multiple users and bots

(BOT) Field 1

  • Name: twitchchatbot
  • Value: 'botname' ie myChatBot

(BOT) Field 2

  • Name: twitchchatbotoauth
  • Value: bot oauth token (including the oauth: part, ie "oauth:sdfeicx345324dfsfe3242")

(USER) Field 1

  • Name: twitchchauser
  • Value: 'username' ie OldDepressedGamer

(USER) Field 2

  • Name: twitchchatuseroauth
  • Value: user oauth token (including the oauth: part, ie "oauth:sdfeicx345324dfsfe3242")

About

The twitch chat extension will send out any messages sent on the channel provided in the settings (or Admin page settings box) using the username provided or defaults to the bot

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
TwitchChatChatMessageReceived trigger_ChatMessageReceived A chat message was received. textMessage field has name and message combined
TwitchChatActionReceived trigger_ChatActionReceived A chat action was received (a /me message)
TwitchChatBanReceived trigger_ChatBanReceived A chat users was banned
TwitchChatMessageDeletedReceived trigger_ChatMessageDeleted A chat message was deleted
TwitchChatPrimePaidUpgradeReceived trigger_ChatPrimePaidUpgrade A user paid to upgrade their prime sub
TwitchChatRaidReceived trigger_ChatRaid Another streamer raided you
TwitchChatRedeemReceived trigger_ChatRedeem Viewer reddemed chat points
TwitchChatResubReceived trigger_ChatResub Someone Resubbed
TwitchChatRitualReceived trigger_ChatRitual Ritual
TwitchChatRoomstateReceived trigger_ChatRoomstate This message contains things like sub-only mode etc
TwitchChatSubscriptionReceived trigger_ChatSubscription Someone Subscribed
TwitchChatTimeoutReceived trigger_ChatTimeout A viewer was timedout
TwitchChatSubMysteryGiftReceived trigger_ChatSubMysteryGift A viewer Gifted a sub
TwitchChatAutoModReceived trigger_ChatAutoMod Automod action happened
TwitchChatReconnect trigger_ChatReconnect Chat Reconnected
TwitchChatAnonGiftPaidUpgradeReceived trigger_ChatAnonGiftPaidUpgrade Your guess is as good as mine on this one
TwitchChatAnonSubMysteryGiftReceived trigger_ChatAnonSubMysteryGift Someone Gifted an Sub Anonymously
TwitchChatAnonSubGiftReceived trigger_ChatAnonSubGift Someone Gifted an Sub
TwitchChatCheerReceived trigger_ChatCheer Someone donated bits
TwitchChatMod trigger_ChatMod A Mod message was received, someone modded maybe or a mod action was performed. let me know if you know which it is
TwitchChatSubGift trigger_ChatSubGift Someone gifted a sub to another viewer
TwitchChatSubscribers trigger_ChatSubscribers Subscribers
TwitchChatVipss trigger_ChatVips Channel Vips
TwitchChatClear trigger_ChatClear Chat was cleared
TwitchChatFollowersOnly trigger_ChatFollowersOnly FollowersOnly mode was changed
TwitchChatGiftPaidUpgrade trigger_ChatGiftPaidUpgrade Someone gifted a paid upgrade
TwitchChatEmoteOnly trigger_ChatEmoteOnly EmoteOnly mode changed
TwitchChatr9kbeta trigger_Chatr9kbeta r9kbeta mode changed
TwitchChatSlowmode trigger_ChatSlowmode Slowmode mode changed
TwitchChatWhisper trigger_ChatWhisper Someone Whispered you or the bot
TwitchChatNotice trigger_ChatNotice You received a notice (ie about chat being in follower mode etc)
TwitchChatUserNotice trigger_ChatUserNotice UserNotice received
TwitchChatDisconnected trigger_ChatDisconnected Chat was Disconnected
TwitchChatConnected trigger_ChatConnected Chat was connected
TwitchChatJoin trigger_ChatJoin Someone Joined the chat

Actions

name trigger description
TwitchChatSendChatMessage action_SendChatMessage Post a message to twitch chat (Note user is case sensitive)

"TwitchChat" Extension Details...

Access to Twitch Chat IRC for sending/receiving message and also some alerts/notifications
Source:

Methods

SaveChatMessagesToServerScheduler()

Poll timer to save the data to server to maintain a chat history over restarts
Source:

SaveConfigToServer()

Save our config to the server
Source:

SaveDataToServer()

Save our data to the server
Source:

SendCredentialsModal(extensionname)

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

SendSettingsWidgetLarge(toExtension)

Send our SettingsWidgetLarge to the extension
Parameters:
Name Type Description
toExtension String
Source:

SendSettingsWidgetSmall(toExtension)

Send our SettingsWidgetSmall to the extension
Parameters:
Name Type Description
toExtension String
Source:

action_SendChatMessage(channel, data)

Send the to twitch on the given channel or fakes a message if debug flag is on and sends it out as if twitch has sent us the message back from the chat trigger
Parameters:
Name Type Description
channel string
data object
Source:

chatLogin(account)

Login the account provided to the IRC channel
Parameters:
Name Type Description
account string
Source:

connectToTwitch(account)

Connect to the IRC chat channel of the current streamer selected in the settings using the account name given
Parameters:
Name Type Description
account string
Source:

findtriggerByMessageType(messagetype)

Finds a trigger by messagetype
Parameters:
Name Type Description
messagetype string
Source:
Returns:
trigger

heartBeatCallback()

Sends out heartbeat messages so other extensions can see our status
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:

joinChatChannel(account)

Join the given account to the currently selected streamer IRC chat channel
Parameters:
Name Type Description
account string
Source:

onDataCenterConnect(socket)

called on connection to the StreamRoller websocket
Parameters:
Name Type Description
socket object
Source:

onDataCenterDisconnect(reason)

Called on websocket disconnect
Parameters:
Name Type Description
reason string
Source:

onDataCenterMessage(server_packet)

Called when we receive a message on the websocket from StreamRoller
Parameters:
Name Type Description
server_packet object
Source:

postChatTrigger(data)

Posts a trigger of type data.messagetype to our channel
Parameters:
Name Type Description
data object
Source:

process_chat_data(channel, tags, chatmessage)

Constructs a ChatMessage type message from the given data. TBD needs to be moved to a trigger type message
Parameters:
Name Type Description
channel string
tags object
chatmessage string
Source:

reconnectChat(account)

reconnect to the IRC client
Parameters:
Name Type Description
account string
Source:

sanitiseHTML(string)

This will replace the strings chars with escape versions so it will be shown rather than parsed in html
Parameters:
Name Type Description
string string
Source:
Returns:
sanitised string

sendAccountNames(toExtension)

Parameters:
Name Type Description
toExtension String
Source:

sendChatBuffer(toExtension)

Send our chat buffer to the extension
Parameters:
Name Type Description
toExtension String
Source: