OpenClaw on Twitch
The bot account, the token generator and refresh, user-id allowlists over usernames, and the 500-character limit
Twitch chat support in OpenClaw runs over Twitch’s chat interface, which is IRC, through the Twurple client: OpenClaw signs in as a Twitch bot account, joins one channel per configured account, and replies in that channel. It ships as an official plugin rather than part of the core install, and picking Twitch during onboarding installs it on demand. Here is the setup, the token question that catches everyone, the access-control rule the docs are firm about, the mention gate, multi-account use, and the limits of plain-text chat.
Setup
- Install the plugin, which needs OpenClaw 2026.4.10 or newer, and create a dedicated Twitch account for the bot or use an existing one.
- Generate credentials with the Twitch Token Generator: a bot token with the chat read and chat write scopes, copying the client id and the access token; find your own Twitch user id with a username-to-id converter.
- Put the token in the environment variable for the default account or in the config, config taking precedence, then run the Gateway; the minimal config is the bot username, the access token, the client id, the channel to join and an allow list of user ids.
- Each joined channel maps to an isolated group session, replies always return to the channel the message came from, the username is who authenticates while the channel is which room to join, and the oauth prefix on the token is optional.
Usernames can change, allowing impersonation. User IDs are permanent.
Tokens and durability
Tokens from the generator cannot be refreshed by OpenClaw and last a few hours, so you regenerate when they expire; for automatic refresh you create your own app in the Twitch Developer Console and add the client secret and a refresh token, after which the plugin uses a refreshing auth provider that renews before expiry and logs each refresh. Without the refresh token it logs that refresh is disabled, and without the client secret it falls back to a static token. Each accepted message is queued durably before dispatch and deduplicated by Twitch’s message id, which protects the accept-to-dispatch window across a restart; but Twitch does not replay a message after the client accepted it, so anything missed before durable admission is gone, and a reconnect does not ask for it again.
Access control and accounts
- The allow list is a hard allowlist of user ids, and when it is set the role list is ignored; leave it unset to use roles instead, moderator, owner, VIP, subscriber or all. The warning at the top of the page is to add one or the other, and the reason for ids over names is the quote above.
- Mentions are required by default, so messages must name the bot; set require-mention to false to answer every allowed message in the channel.
- Several channels mean several accounts, each with its own access token since the environment variable covers only the default one, and a default-account key picks which is default; do not mix top-level credentials with the accounts map.
OpenClaw on IRC is the protocol underneath this channel, with the same durability caveat, and OpenClaw on Discord the other chat-community channel with a mention gate.
Troubleshooting and limits
When the bot does not respond, check that your user id is in the allow list, or temporarily allow all roles to test, check the mention gate, and check that the bot joined the channel named in the config; on connection or auth errors, verify the token value and its two scopes and, with refresh, the secret and refresh token. Messages are capped at 500 characters and chunked at word boundaries, Markdown is stripped with newlines becoming spaces, text that becomes empty is recorded as intentionally not sent, and OpenClaw adds no rate limiting of its own because the chat client handles Twitch’s. OpenClaw secrets is where a token belongs rather than in a committed config file, which the safety list repeats: treat tokens like passwords, refresh them, allowlist ids, scope minimally, and restart the Gateway if stuck after confirming nothing else owns the session.
On Diali
Twitch is not among the channels Diali connects today: the ones we run are WhatsApp, Telegram, Discord, Slack, Mattermost, Matrix, SMS and voice, and a self-run instance is where this plugin lives for now. Connect your first channel in five minutes shows our connect flow, Hosted OpenClaw on Diali is the assistant and Diali security describes the boundary.
- One account, one channel, one isolated session.
- Allowlist user ids, never usernames.
- Generator tokens expire; your own app refreshes.
Stop reading about it, build one
Set up an agent, pick a channel, and have it working inside the app you already keep open.
