बंडल किया गया plugin
Twitch मौजूदा OpenClaw रिलीज़ में बंडल किए गए plugin के रूप में आता है, इसलिए सामान्य packaged builds को अलग इंस्टॉल की आवश्यकता नहीं होती।
- npm registry
- Local checkout
त्वरित setup (शुरुआती)
सुनिश्चित करें कि plugin उपलब्ध है
मौजूदा packaged OpenClaw रिलीज़ इसे पहले से bundle करती हैं। पुराने/custom installs ऊपर दिए गए commands से इसे मैन्युअल रूप से जोड़ सकते हैं।
credentials जनरेट करें
Twitch Token Generator का उपयोग करें:
- Bot Token चुनें
- सत्यापित करें कि scopes
chat:readऔरchat:writeचुने गए हैं - Client ID और Access Token कॉपी करें
अपना Twitch user ID खोजें
username को Twitch user ID में बदलने के लिए https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/ का उपयोग करें।
token configure करें
- Env:
OPENCLAW_TWITCH_ACCESS_TOKEN=...(केवल default account) - या config:
channels.twitch.accessToken
यह क्या है
- Gateway के स्वामित्व वाला Twitch channel।
- Deterministic routing: replies हमेशा Twitch पर वापस जाते हैं।
- प्रत्येक account एक isolated session key
agent:<agentId>:twitch:<accountName>से map होता है। usernamebot का account है (जो authenticate करता है),channelवह chat room है जिसमें शामिल होना है।
Setup (विस्तृत)
credentials जनरेट करें
Twitch Token Generator का उपयोग करें:- Bot Token चुनें
- सत्यापित करें कि scopes
chat:readऔरchat:writeचुने गए हैं - Client ID और Access Token कॉपी करें
मैन्युअल app registration की आवश्यकता नहीं है। Tokens कई घंटों के बाद expire हो जाते हैं।
bot configure करें
- Env var (केवल default account)
- Config
Access control (अनुशंसित)
allowFrom को प्राथमिकता दें। यदि आप role-based access चाहते हैं, तो इसके बजाय allowedRoles का उपयोग करें।
उपलब्ध roles: "moderator", "owner", "vip", "subscriber", "all".
user IDs क्यों? Usernames बदल सकते हैं, जिससे impersonation संभव हो जाता है। User IDs स्थायी होते हैं।अपना Twitch user ID खोजें: https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/ (अपने Twitch username को ID में बदलें)
Token refresh (वैकल्पिक)
Twitch Token Generator के tokens अपने आप refresh नहीं किए जा सकते - expire होने पर regenerate करें। automatic token refresh के लिए, Twitch Developer Console पर अपना Twitch application बनाएं और config में जोड़ें:Multi-account support
प्रत्येक account के tokens के साथchannels.twitch.accounts का उपयोग करें। shared pattern के लिए Configuration देखें।
उदाहरण (दो channels में एक bot account):
प्रत्येक account को अपना token चाहिए (प्रति channel एक token)।
Access control
- User ID allowlist (सबसे सुरक्षित)
- Role-based
- @mention requirement disable करें
Troubleshooting
पहले, diagnostic commands चलाएं:Bot messages का जवाब नहीं देता
Bot messages का जवाब नहीं देता
- Access control जांचें: सुनिश्चित करें कि आपका user ID
allowFromमें है, या test करने के लिए अस्थायी रूप सेallowFromहटाएं औरallowedRoles: ["all"]सेट करें। - जांचें कि bot channel में है: bot को
channelमें निर्दिष्ट channel से जुड़ना होगा।
Token समस्याएं
Token समस्याएं
“Failed to connect” या authentication errors:
- सत्यापित करें कि
accessTokenOAuth access token value है (आमतौर परoauth:prefix से शुरू होता है) - जांचें कि token में
chat:readऔरchat:writescopes हैं - यदि token refresh का उपयोग कर रहे हैं, तो सत्यापित करें कि
clientSecretऔरrefreshTokenसेट हैं
Token refresh काम नहीं कर रहा
Token refresh काम नहीं कर रहा
refresh events के लिए logs जांचें:यदि आपको “token refresh disabled (no refresh token)” दिखता है:
- सुनिश्चित करें कि
clientSecretदिया गया है - सुनिश्चित करें कि
refreshTokenदिया गया है
Config
Account config
Bot username.
chat:read और chat:write के साथ OAuth access token.Twitch Client ID (Token Generator या आपके app से).
जुड़ने वाला channel.
इस account को enable करें.
वैकल्पिक: automatic token refresh के लिए.
वैकल्पिक: automatic token refresh के लिए.
seconds में token expiry.
Token प्राप्त होने का timestamp.
User ID allowlist.
Role-based access control.
@mention आवश्यक करें.
Provider options
channels.twitch.enabled- channel startup enable/disable करेंchannels.twitch.username- Bot username (simplified single-account config)channels.twitch.accessToken- OAuth access token (simplified single-account config)channels.twitch.clientId- Twitch Client ID (simplified single-account config)channels.twitch.channel- जुड़ने वाला channel (simplified single-account config)channels.twitch.accounts.<accountName>- Multi-account config (ऊपर दिए गए सभी account fields)
Tool actions
agenttwitch को action के साथ call कर सकता है:
send- channel को message भेजें
सुरक्षा और ops
- tokens को passwords की तरह मानें — tokens को कभी git में commit न करें।
- लंबे समय तक चलने वाले bots के लिए automatic token refresh का उपयोग करें।
- access control के लिए usernames के बजाय user ID allowlists का उपयोग करें।
- token refresh events और connection status के लिए logs monitor करें।
- tokens को न्यूनतम scope दें — केवल
chat:readऔरchat:writerequest करें। - यदि अटके हों: यह पुष्टि करने के बाद gateway restart करें कि कोई अन्य process session का स्वामी नहीं है।
सीमाएं
- प्रति message 500 characters (word boundaries पर auto-chunked).
- chunking से पहले Markdown हटा दिया जाता है।
- कोई rate limiting नहीं (Twitch की built-in rate limits का उपयोग करता है).
संबंधित
- Channel Routing — messages के लिए session routing
- Channels Overview — सभी supported channels
- Groups — group chat behavior और mention gating
- Pairing — DM authentication और pairing flow
- Security — access model और hardening