Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Twitch chat support via IRC connection. OpenClaw connects as a Twitch user (bot account) to receive and send messages in channels.
If you are on an older build or a custom install that excludes Twitch, install a current npm package when one is published:
If npm reports the OpenClaw-owned package as deprecated, use a current packaged OpenClaw build or the local checkout path until a newer npm package is published.
Details: Plugins
text* Select **Bot Token** * Verify scopes `chat:read` and `chat:write` are selected * Copy the **Client ID** and **Access Token**
textIf both are set, config takes precedence (env fallback is default-account only).
Minimal config:
json5{ channels: { twitch: { enabled: true, username: "openclaw", // Bot's Twitch account accessToken: "oauth:abc123...", // OAuth Access Token (or use OPENCLAW_TWITCH_ACCESS_TOKEN env var) clientId: "xyz789...", // Client ID from Token Generator channel: "vevisk", // Which Twitch channel's chat to join (required) allowFrom: ["123456789"], // (recommended) Your Twitch user ID only - get it from https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/ }, }, }
agent:<agentId>:twitch:<accountName>usernamechannelchat:readchat:writeIf both env and config are set, config takes precedence.
json5{ channels: { twitch: { allowFrom: ["123456789"], // (recommended) Your Twitch user ID only }, }, }
Prefer
allowFromallowedRolesAvailable roles:
"moderator""owner""vip""subscriber""all"Find your Twitch user ID: https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/ (Convert your Twitch username to ID)
Tokens from Twitch Token Generator cannot be automatically refreshed - regenerate when expired.
For automatic token refresh, create your own Twitch application at Twitch Developer Console and add to config:
json5{ channels: { twitch: { clientSecret: "your_client_secret", refreshToken: "your_refresh_token", }, }, }
The bot automatically refreshes tokens before expiration and logs refresh events.
Use
channels.twitch.accountsExample (one bot account in two channels):
json5{ channels: { twitch: { accounts: { channel1: { username: "openclaw", accessToken: "oauth:abc123...", clientId: "xyz789...", channel: "vevisk", }, channel2: { username: "openclaw", accessToken: "oauth:def456...", clientId: "uvw012...", channel: "secondchannel", }, }, }, }, }
text`allowFrom` is a hard allowlist. When set, only those user IDs are allowed. If you want role-based access, leave `allowFrom` unset and configure `allowedRoles` instead.
text```json5} { channels: { twitch: { accounts: { default: { requireMention: false, }, }, }, }, } ```
First, run diagnostic commands:
bashopenclaw doctor openclaw channels status --probe
channels.twitch.enabledchannels.twitch.usernamechannels.twitch.accessTokenchannels.twitch.clientIdchannels.twitch.channelchannels.twitch.accounts.<accountName>Full example:
json5{ channels: { twitch: { enabled: true, username: "openclaw", accessToken: "oauth:abc123...", clientId: "xyz789...", channel: "vevisk", clientSecret: "secret123...", refreshToken: "refresh456...", allowFrom: ["123456789"], allowedRoles: ["moderator", "vip"], accounts: { default: { username: "mybot", accessToken: "oauth:abc123...", clientId: "xyz789...", channel: "your_channel", enabled: true, clientSecret: "secret123...", refreshToken: "refresh456...", expiresIn: 14400, obtainmentTimestamp: 1706092800000, allowFrom: ["123456789", "987654321"], allowedRoles: ["moderator"], }, }, }, }, }
The agent can call
twitchsendExample:
json5{ action: "twitch", params: { message: "Hello Twitch!", to: "#mychannel", }, }
chat:readchat:write© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine