Skip to content

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

ChannelTransportPublic IP RequiredSDK
Feishu (Lark)WebSocketNo@larksuiteoapi/node-sdk
DingTalkStream (WebSocket)Nodingtalk-stream
WeComWebSocketNo@wecom/aibot-node-sdk
SlackSocket Mode (WebSocket)No@slack/bolt
TelegramLong-pollingNogrammy
DiscordGateway WebSocketNodiscord.js
WeChat (微信)Long-PollingNoNone (built-in fetch)
CustomAnyDependsYour 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:

  1. Reads channels config from golem.yaml
  2. Dynamically imports the SDK for each configured channel
  3. Starts all adapters in parallel alongside the HTTP service
  4. Routes incoming messages through session key resolution → context building → assistant.chat()
  5. 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:

ChannelMax lengthSplit behavior
Feishu4,000 charsMulti-message
DingTalk4,000 charsMulti-message
WeCom2,048 charsMulti-message
Slack4,000 charsMulti-message
Telegram4,096 charsMulti-message
Discord2,000 charsMulti-message
WeChat2,000 charsMulti-message
CustomConfigurable via maxMessageLengthMulti-message

Message Format Conversion

GolemBot automatically converts standard Markdown to each platform's native format:

ChannelOutput FormatConversion
FeishuCard v2 (interactive)Native Markdown rendering — headings, lists, code blocks, tables
Slackmrkdwn**bold***bold*, *italic*_italic_, links rewritten
TelegramHTML**bold**<b>, code blocks → <pre><code>, blockquotes → <blockquote>
DiscordMarkdown (native)No conversion needed — Discord renders Markdown natively
DingTalkMarkdown (native)Passed through as-is
WeComPlain textMarkdown stripped (WeCom text API has limited formatting)
WeChatPlain textPassed 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:

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
ChannelImage SourceCaption/Text
Feishuimage messages + inline images in post (rich text)Post text content extracted
SlackFile attachments with image content typeMessage text preserved
Telegrammessage.photo (picks largest size)message.caption used as text
Discordmessage.attachments with image content typeMessage text preserved
DingTalkpicture messages + images in richTextRich text content extracted
WeComimage messages via media APIText set to (image)
WeChatCDN download + AES-128-ECB decryptText 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

bash
golembot gateway --verbose

The --verbose flag enables per-channel log lines, useful for debugging.

SDK Dependencies

Channel SDKs are optional peer dependencies. Install only what you need:

bash
# 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.yaml

If a configured channel's SDK is not installed, the gateway will print an error with installation instructions.

What's Next

Released under the MIT License.