openclaw-channel-dmwork
v0.3.3
Published
DMWork channel plugin for OpenClaw via WuKongIM WebSocket
Readme
openclaw-channel-dmwork
DMWork channel plugin for OpenClaw. Connects via WuKongIM WebSocket for real-time messaging.
Repository: https://github.com/yujiawei/dmwork-adapters
Prerequisites
- Node.js >= 18
- OpenClaw installed and configured
- A bot created via BotFather in DMWork (send
/newbotto BotFather)
Install as OpenClaw Extension
git clone https://github.com/yujiawei/dmwork-adapters.git
cp -r dmwork-adapters/openclaw-channel-dmwork ~/.openclaw/extensions/dmwork
cd ~/.openclaw/extensions/dmwork && npm installConfigure
Add to your ~/.openclaw/config.yaml:
channels:
dmwork:
botToken: "bf_your_token_here" # Bot token from BotFather
apiUrl: "http://your-server:8090" # DMWork server API URL
# wsUrl: "ws://your-server:5200" # Optional — auto-detected from register if omittedConfiguration fields:
botToken(required): Bot token from BotFather (bf_prefix)apiUrl(required): DMWork server API URL, e.g.http://192.168.1.100:8090wsUrl(optional): WuKongIM WebSocket URL. Auto-detected from register if omitted.
Run
openclaw gateway restartThe plugin is loaded automatically by OpenClaw when the gateway starts.
What it does
- Registers the bot with the DMWork server via REST API
- Connects to WuKongIM WebSocket for real-time message receiving
- Auto-reconnects on disconnection
- Sends a greeting to the bot owner on connect
- Dispatches incoming messages to OpenClaw's message handler
- Supports streaming responses (start/send/end), typing indicators, and read receipts
As an OpenClaw Plugin
The index.ts exports a standard OpenClaw plugin object. When loaded by OpenClaw:
register(api)is called automaticallyapi.runtimeis injected for logging and lifecycle managementapi.registerChannel()registers the DMWork channel plugin- Configuration is read from
channels.dmworkin OpenClaw's config
The plugin uses the ChannelPlugin SDK interface with support for:
- Direct messages and group chats
- Multi-account configuration via
channels.dmwork.accounts - Config hot-reload on
channels.dmworkprefix changes
Disconnect
To disconnect the bot, send /disconnect to BotFather in DMWork. This invalidates the current IM token and kicks the WebSocket connection.
