openclaw-channel-dmwork
v0.6.4
Published
DMWork channel plugin for OpenClaw via WuKongIM WebSocket
Readme
openclaw-channel-dmwork
DMWork channel plugin for OpenClaw. Connects via DMWORK WebSocket for real-time messaging.
Repository: https://github.com/yujiawei/dmwork-adapters
Prerequisites
- Node.js >= 18
- OpenClaw installed and configured (
npm i -g openclaw) - A bot created via BotFather in DMWork (send
/newbotto BotFather)
Install
One-command install via npx (BotFather will provide the exact command):
npx -y openclaw-channel-dmwork install \
--bot-token bf_your_token_here \
--api-url http://your-server:8090 \
--account-id my_botThis will:
- Install the plugin via
openclaw plugins install - Configure the bot account in
channels.dmwork.accounts.<account-id> - Restart the OpenClaw gateway
Interactive install
Run without arguments to be prompted for each value:
npx -y openclaw-channel-dmwork installCLI Commands
# Update the plugin to the latest version
npx -y openclaw-channel-dmwork update
# Diagnose plugin health
npx -y openclaw-channel-dmwork doctor
# Uninstall (removes plugin and all bot configs)
npx -y openclaw-channel-dmwork uninstall
# Remove a single bot account
npx -y openclaw-channel-dmwork remove-account --account-id my_botOpenClaw internal commands
After installation, these commands are available inside OpenClaw:
/dmwork_doctor # Check plugin status and connectivity
/dmwork_doctor my_bot # Check a specific accountConfiguration
Bot accounts are stored in ~/.openclaw/openclaw.json under channels.dmwork.accounts:
{
"channels": {
"dmwork": {
"apiUrl": "http://your-server:8090",
"accounts": {
"my_bot": {
"botToken": "bf_your_token_here",
"apiUrl": "http://your-server:8090"
},
"another_bot": {
"botToken": "bf_another_token",
"apiUrl": "https://im.example.com/api"
}
}
}
}
}Configuration fields per account:
botToken(required): Bot token from BotFather (bf_prefix)apiUrl(required): DMWork server API URLwsUrl(optional): DMWORK WebSocket URL. Auto-detected if omitted.requireMention(optional): Only respond when @mentioned in groupshistoryLimit(optional): Group chat history message limit (default: 20)
What it does
- Registers the bot with the DMWork server via REST API
- Connects to DMWORK 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 pluginapi.registerCommand()registers/dmwork_doctor- 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.
