OpenClaw Twitch Channel
Connect OpenClaw to Twitch chat via IRC, enabling your AI assistant to interact with viewers in real time. Install the Twitch plugin, configure an OAuth token with chat scopes, and your bot can join channels, respond to mentions, and manage conversations with role-based access control.
Twitch Supported Features
Text Messages
Supported
Media & Files
Not Supported
Reactions
Not Supported
Threads
Not Supported
Voice Messages
Not Supported
Group Chat
Supported
Twitch Prerequisites
- A Twitch account to use as the bot identity
- An OAuth Access Token with chat:read and chat:write scopes
- A Client ID from the Twitch Developer Console
- OpenClaw Gateway installed and running
- The Twitch plugin installed via 'openclaw plugins install @openclaw/twitch'
Twitch Quick Setup
Install the Twitch plugin
Run 'openclaw plugins install @openclaw/twitch' to add Twitch support. Alternatively, install from a local path with 'openclaw plugins install ./extensions/twitch'.
Get your OAuth token and Client ID
Visit twitchtokengenerator.com and select 'Bot Token' with chat:read and chat:write scopes. Copy the access token. Also obtain your Client ID from the Twitch Developer Console (dev.twitch.tv/console).
Configure and launch
Add the Twitch channel configuration to ~/.openclaw/openclaw.json with your username, accessToken, clientId, and target channel. Start the Gateway with 'openclaw start' and send a message mentioning the bot in the Twitch channel to verify.
Twitch Configuration Example
{
"channels": {
"twitch": {
"enabled": true,
"username": "mybotname",
"accessToken": "oauth:abc123...",
"clientId": "your-client-id",
"channel": "targetchannel",
"allowFrom": ["123456789"]
}
}
}
Twitch Deep Dive
Architecture Overview
Getting Your Credentials
# Environment variable (default account only)
export OPENCLAW_TWITCH_ACCESS_TOKEN=oauth:abc123...
Automatic Token Refresh
{
"channels": {
"twitch": {
"accessToken": "oauth:abc123...",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"refreshToken": "your-refresh-token"
}
}
}
Access Control with User IDs
{
"channels": {
"twitch": {
"allowFrom": ["123456789", "987654321"]
}
}
}
Role-Based Access Control
{
"channels": {
"twitch": {
"allowedRoles": ["moderator", "vip"]
}
}
}
Mention Requirement
{
"channels": {
"twitch": {
"requireMention": false
}
}
}
Multi-Account Setup
{
"channels": {
"twitch": {
"accounts": {
"gaming-bot": {
"username": "gamingbot",
"accessToken": "oauth:token1...",
"clientId": "client-id-1",
"channel": "gamingchannel",
"allowedRoles": ["subscriber"]
},
"mod-bot": {
"username": "modbot",
"accessToken": "oauth:token2...",
"clientId": "client-id-2",
"channel": "modchannel",
"allowFrom": ["111222333"]
}
}
}
}
}
Agent Tool Actions
{
"action": "twitch",
"params": {
"message": "Hello Twitch!",
"to": "#mychannel"
}
}
Rate Limits and Message Constraints
Twitch Configuration Reference
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the Twitch channel |
| username | string | "" | The Twitch account name used by the bot |
| accessToken | string | "" | OAuth token with chat:read and chat:write scopes (must start with 'oauth:') |
| clientId | string | "" | Client ID from the Twitch Developer Console |
| channel | string | "" | Target Twitch channel to join (required) |
| clientSecret | string | "" | Client secret for automatic token refresh |
| refreshToken | string | "" | Refresh token for automatic token renewal |
| expiresIn | number | — | Token expiry duration in seconds |
| obtainmentTimestamp | number | — | Timestamp (ms) when the current token was obtained |
| allowFrom | string[] | [] | Twitch user ID allowlist for hard access restriction |
| allowedRoles | string[] | [] | Role-based access control (moderator, owner, vip, subscriber, all) |
| requireMention | boolean | true | Whether the bot requires an @mention to respond |
| accounts.<id>.username | string | "" | Bot username for a specific account in multi-account mode |
| accounts.<id>.accessToken | string | "" | OAuth token for a specific account |
| accounts.<id>.channel | string | "" | Target channel for a specific account |
Enable or disable the Twitch channel
The Twitch account name used by the bot
OAuth token with chat:read and chat:write scopes (must start with 'oauth:')
Client ID from the Twitch Developer Console
Target Twitch channel to join (required)
Client secret for automatic token refresh
Refresh token for automatic token renewal
Token expiry duration in seconds
Timestamp (ms) when the current token was obtained
Twitch user ID allowlist for hard access restriction
Role-based access control (moderator, owner, vip, subscriber, all)
Whether the bot requires an @mention to respond
Bot username for a specific account in multi-account mode
OAuth token for a specific account
Target channel for a specific account
Twitch Frequently Asked Questions
Twitch Troubleshooting
The allowFrom list may not include your user ID, or the bot is not detecting the @mention.
The OAuth token is invalid, expired, or missing required scopes.
The clientSecret or refreshToken is missing or incorrect.
The bot is exceeding Twitch's rate limits.
The channel name may be incorrect or the account has been banned from the channel.