Channel Overview
GolemBot's gateway connects your assistant to IM platforms. Each platform is handled by a channel adapter that translates between the IM SDK and GolemBot's assistant.chat() API.
Supported Channels
| Channel | Transport | Public IP Required | SDK |
|---|---|---|---|
| Feishu (Lark) | WebSocket | No | @larksuiteoapi/node-sdk |
| DingTalk | Stream (WebSocket) | No | dingtalk-stream |
| WeCom | WebSocket | No | @wecom/aibot-node-sdk |
| Slack | Socket Mode (WebSocket) | No | @slack/bolt |
| Telegram | Long-polling | No | grammy |
| Discord | Gateway WebSocket | No | discord.js |
| WeChat (微信) | Long-Polling | No | None (built-in fetch) |
| Custom | Any | Depends | Your own adapter class |
All channels work behind NAT
All 7 built-in channels use WebSocket, long-polling, or Socket Mode — no public IP or port forwarding required.
Architecture
IM Platform → Channel Adapter → assistant.chat() → text response → adapter.reply()The gateway:
- Reads
channelsconfig fromgolem.yaml - Dynamically imports the SDK for each configured channel
- Starts all adapters in parallel alongside the HTTP service
- Routes incoming messages through session key resolution → context building →
assistant.chat() - Accumulates the full text response, splits it within platform limits, and sends chunk by chunk
Message Limits
Each platform has a maximum message length. GolemBot automatically splits long responses:
| Channel | Max length | Split behavior |
|---|---|---|
| Feishu | 4,000 chars | Multi-message |
| DingTalk | 4,000 chars | Multi-message |
| WeCom | 2,048 chars | Multi-message |
| Slack | 4,000 chars | Multi-message |
| Telegram | 4,096 chars | Multi-message |
| Discord | 2,000 chars | Multi-message |
| 2,000 chars | Multi-message | |
| Custom | Configurable via maxMessageLength | Multi-message |
Message Format Conversion
GolemBot automatically converts standard Markdown to each platform's native format:
| Channel | Output Format | Conversion |
|---|---|---|
| Feishu | Card v2 (interactive) | Native Markdown rendering — headings, lists, code blocks, tables |
| Slack | mrkdwn | **bold** → *bold*, *italic* → _italic_, links rewritten |
| Telegram | HTML | **bold** → <b>, code blocks → <pre><code>, blockquotes → <blockquote> |
| Discord | Markdown (native) | No conversion needed — Discord renders Markdown natively |
| DingTalk | Markdown (native) | Passed through as-is |
| WeCom | Plain text | Markdown stripped (WeCom text API has limited formatting) |
| Plain text | Passed through as-is (WeChat text API) |
The AI agent is encouraged to use standard Markdown syntax (headings, lists, bold, code blocks, etc.) — each adapter handles the platform-specific conversion automatically.
Group Chat, Mentions & Quote Reply
GolemBot supports group chat response policies (mention-only / smart / always), incoming and outgoing @mention resolution, and quote reply on supported platforms.
See Group Chat for full details.
Inbox & History Fetch
When enabled, messages are queued persistently and the bot catches up on missed messages after restart via intelligent triage.
See Inbox & History Fetch for the full guide and platform support table.
Custom Adapters
Connect any platform by writing an adapter class and referencing it with _adapter in golem.yaml:
channels:
my-platform:
_adapter: ./adapters/my-platform.mjs # or npm package name
token: ${MY_PLATFORM_TOKEN}See Channel Adapter API for the full interface, implementation guide, and examples.
Image Support (Multimodal)
GolemBot supports image messages across all 7 built-in channels. When a user sends an image (photo, screenshot, file attachment), the adapter downloads it and passes it through the full pipeline:
User sends image → Adapter downloads to Buffer → gateway passes to assistant.chat()
→ image saved to .golem/images/ → file path appended to prompt → agent reads the file
→ cleanup after response| Channel | Image Source | Caption/Text |
|---|---|---|
| Feishu | image messages + inline images in post (rich text) | Post text content extracted |
| Slack | File attachments with image content type | Message text preserved |
| Telegram | message.photo (picks largest size) | message.caption used as text |
| Discord | message.attachments with image content type | Message text preserved |
| DingTalk | picture messages + images in richText | Rich text content extracted |
| WeCom | image messages via media API | Text set to (image) |
| CDN download + AES-128-ECB decrypt | Text set to (image) |
How it works: Images are saved as temporary files in .golem/images/ and referenced by absolute path in the prompt. This works universally with all engines (Cursor, Claude Code, OpenCode, Codex) since every coding CLI can read local files. For Codex specifically, GolemBot also forwards image attachments natively via --image <path>. Files are automatically cleaned up after the agent responds.
HTTP API: The POST /chat endpoint also accepts base64-encoded images — see HTTP API.
Proactive Messaging (Scheduled Tasks)
Beyond responding to incoming messages, GolemBot can proactively send messages to IM channels on a schedule. Define tasks in golem.yaml and the agent will execute prompts automatically, pushing results to your IM channels.
See Scheduled Tasks for full configuration, management commands, and use case examples.
Starting the Gateway
golembot gateway --verboseThe --verbose flag enables per-channel log lines, useful for debugging.
SDK Dependencies
Channel SDKs are optional peer dependencies. Install only what you need:
# Feishu
pnpm add @larksuiteoapi/node-sdk
# DingTalk
pnpm add dingtalk-stream
# WeCom
pnpm add @wecom/aibot-node-sdk
# Slack
pnpm add @slack/bolt
# Telegram
pnpm add grammy
# Discord
pnpm add discord.js
# WeChat (no SDK needed — uses built-in fetch)
# Just add the token to golem.yamlIf a configured channel's SDK is not installed, the gateway will print an error with installation instructions.
What's Next
- Feishu, DingTalk, WeCom, WeChat, Slack, Telegram, Discord — per-channel setup guides
- Group Chat — response policies, @mention, quote reply
- Inbox & History Fetch — crash-safe queue, offline catch-up
- Channel Adapter API — build custom adapters