DingTalk
Connect your GolemBot assistant to DingTalk using Stream mode (WebSocket). No public IP required.
Prerequisites
bash
pnpm add dingtalk-streamDingTalk Open Platform Setup
- Go to DingTalk Developer Portal and create a robot application
- Under Credentials, copy the Client ID (AppKey) and Client Secret (AppSecret)
- Under Message Push, select Stream mode
- Configure the bot's permissions as needed
Configuration
yaml
# golem.yaml
channels:
dingtalk:
clientId: ${DINGTALK_CLIENT_ID}
clientSecret: ${DINGTALK_CLIENT_SECRET}sh
# .env
DINGTALK_CLIENT_ID=dingxxxxxxxxxx
DINGTALK_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxHow It Works
- Transport: Stream mode via
DWClientfromdingtalk-stream, using theTOPIC_ROBOTtopic - Events: Receives robot messages via the stream connection
- Reply: Posts response to
data.sessionWebhookwithx-acs-dingtalk-access-tokenheader - Chat types: Supports both DMs and group chats
Start
bash
golembot gateway --verboseThe adapter connects to DingTalk's stream service on startup. Messages appear with [dingtalk] prefix when --verbose is enabled.
Notes
- Stream mode uses outbound WebSocket — works behind NAT/firewalls
- Replies are sent to the session webhook URL provided in each incoming message
- The max message length is 4,000 characters; longer responses are automatically split