AutonomousKoi - Twitch

The twitch module provides access to Twitch on behalf of other modules; it's not very useful on its own. There are three facets to Twitch access. The Twitch API allows tools to request information about the state of Twitch and to request for actions to be taken. Twitch EventSub provides notification about events, such as a streamer going live or a new follower. Twitch Chat provides access to real-time chat with stream participants.

The twitch module has one link, providing controls. These controls are explained below.

Tokens

When a program talks to Twitch, Twitch needs to know who the program represents. This is done with a token, a small piece of data similar to a password. Unlike a password, the token has only a specific set of permissions rather than all the permissions of the user it represents. This allows the user to have the program act on their behalf without giving the program full control of their account.

To get a token, the program creates a special link that takes the user to Twitch. Twitch will show the user the permissions the program is requesting and asks the user if those permissions should be granted. If the user agrees, Twitch will generate the new token and get it back to the program.

Connected Twitch Accounts

The twitch module can have tokens from multiple accounts. The account used to talk to the Twitch API can be different than the account used to interact with chat.

The New Connection button will create a link to get a token from Twitch. The link can be clicked or copyed and pasted into a different browser. The link will request a token from Twitch tied to the Twitch account the browser is logged into. To get a token tied to a different account, you may need to log into that account in a different browser or a Private/Incognito window. The link will become invalid if AutonomousKoi or the twitch module is restarted.

A button will be shown for each account the twitch module has a token for. Clicking the button will show a confirmation to remove the token. If you confirm the deletion, the twitch module will tell Twitch to invalidate the token and then it will delete its copy of the token.

Chat

The left side of the Chat section has settings for connecting to Twitch chat.

The Status field shows the current status of the connection to Twitch Chat. Hovering your mouse cursor over the Status symbol will provide more details about the connection status.

The Enabled setting specifies whether or not the twitch module should connect to Twitch Chat. Changing this setting will not take effect until you hit the Save button.

The Using Account selector allows you to choose which connected Twitch account to use for chat. You must hit the Save button to save this setting and it won't take effect until the next time chat connects.

The Chat Message Prefix field allows you to specify a prefix for every message the twitch module sends to chat. For example, if the prefix is set to [bot] and a module sends the message how are you?, The message will show in chat as [bot] how are you?. This can help chat participants understand that the message came from a bot and not a human. This setting is saved by hitting the Save button and takes effect immediately.

The right side of the Chat provides access to live Twitch Chat. Messages are shown in real-time. You can send messages to chat as the bot.

Channel Events

The Channel Events section configures whether the twitch module connects to Twitch to receive notifications of events. This is currently functional but unused.