openclaw-channel-luffa
v1.0.7
Published
Luffa Web3 messaging platform channel plugin for OpenClaw
Maintainers
Readme
OpenClaw Luffa Channel
Luffa Web3 messaging platform channel plugin for OpenClaw.
Features
- HTTP polling for message reception (1 second interval)
- Direct user messages support (type=0)
- Group messages support (type=1)
- Message deduplication via msgId
- Message text sending
- Configurable polling interval
- Allow-list for users and groups
- Multi-account support
API Endpoints
Based on Luffa Robot API:
- Receive:
POST https://apibot.luffa.im/robot/receive - Send:
POST https://apibot.luffa.im/robot/send
Installation
openclaw plugins install @wangpaul667/openclaw-channel-luffaFor local development:
openclaw plugins install -l /path/to/openclaw-channel-luffaConfiguration
Add to your ~/.openclaw/openclaw.json:
{
"channels": {
"luffa": {
"enabled": true,
"robotKey": "your_robot_secret_key",
"pollInterval": 1000,
"allowList": {
"users": ["user_id_1", "user_id_2"],
"groups": ["group_id_1"]
}
}
}
}Configuration Options
| Option | Type | Default | Description | |--------|------|---------|-------------| | enabled | boolean | false | Enable/disable the channel | | robotKey | string | - | Luffa robot secret key | | pollInterval | number | 1000 | Polling interval in milliseconds | | allowList.users | string[] | - | Allowed user IDs | | allowList.groups | string[] | - | Allowed group IDs |
Multi-Account Configuration
{
"channels": {
"luffa": {
"accounts": {
"default": {
"robotKey": "key1",
"enabled": true,
"pollInterval": 1000
},
"bot2": {
"robotKey": "key2",
"enabled": true,
"allowList": {
"users": ["allowed_user"]
}
}
}
}
}
}Environment Variables
| Variable | Description | |----------|-------------| | LUFFA_ROBOT_KEY | Robot secret key (fallback) |
Message Format
Receive (POST /robot/receive)
Request:
{"secret": "Robot Key"}Response:
[
{
"uid": "Luffa User ID",
"count": 1,
"message": ["{\"atList\":[],\"text\":\"Chat content\",\"urlLink\":null,\"msgId\":\"Message ID\"}"],
"type": 0
},
{
"uid": "Luffa Group ID",
"count": 1,
"message": ["{\"uid\":\"Sender Luffa ID\",\"atList\":[],\"text\":\"Chat content\",\"urlLink\":null,\"msgId\":\"Message ID\"}"],
"type": 1
}
]Send (POST /robot/send)
Request:
{
"secret": "Robot Key",
"uid": "Luffa user ID",
"msg": "{\"text\":\"Message content\"}"
}Development
npm install
npm run build
npm testLocal Testing
# Build and install locally
npm run build
openclaw plugins install -l .
# Or copy to extensions directory
rm -rf ~/.openclaw/extensions/openclaw-channel-luffa
cp -r dist ~/.openclaw/extensions/openclaw-channel-luffa
openclaw gateway restartArchitecture
src/
├── index.ts # Plugin entry point
├── channel/
│ ├── index.ts # Main channel logic
│ ├── config.ts # Configuration adapter
│ ├── dock.ts # Channel dock
│ └── outbound.ts # Outbound message adapter
├── client/
│ └── LuffaHttpClient.ts # HTTP client for Luffa API
├── normalizer/
│ └── MessageNormalizer.ts # Message format conversion
└── types/
├── index.ts # TypeScript type definitions
└── plugin-sdk.d.ts # OpenClaw SDK typesPublishing
This plugin is published to npm under @openclawcity/openclaw-channel-luffa.
For Maintainers
# 1. Update version
npm version patch|minor|major
# 2. Build and test
npm run build
npm test
# 3. Publish to npm
npm publish --access public
# 4. Push tags
git push --follow-tags
License
MIT
