WIP — Work in Progress
Pachca (Пачка) channel plugin for OpenClaw. Enables OpenClaw agents to communicate through the Pachca corporate messenger via REST API and webhooks.
src/client.ts— Pachca REST API client (messages, chats, users, reactions, file uploads)src/channel.ts— OpenClawChannelPluginimplementation (outbound, security, gateway)src/monitor.ts— Webhook listener (signature verification, event parsing)src/send.ts— Outbound message sending (text + media)src/accounts.ts— Account resolution from OpenClaw configsrc/setup-core.ts— Setup adapter (placeholder)
This is an early prototype. The plugin structure follows the patterns used by built-in channels (IRC, Telegram, Slack), but several critical pieces are incomplete.
- Plugin manifest and entry point (
defineChannelPluginEntry) - Account resolution from
channels.pachca.*config - Pachca API client with message sending, editing, reactions, file uploads
- Outbound
sendTextandsendMediahooks - Webhook signature verification and event parsing
- Config:
channels.pachca.token,channels.pachca.webhookSecret,channels.pachca.apiBase
- Webhook listener is a stub —
monitor.tshas parsing logic but doesn't register an HTTP route on the gateway. Needs integration with OpenClaw's webhook router (follow Slack's Socket Mode pattern or register a POST handler). - File upload flow incomplete —
sendMediaPachcasends a text placeholder instead of the full 3-step flow (createUpload → PUT to S3 → sendMessage with key). - Setup wizard —
setup-core.tsis a placeholder. Needs interactive token configuration flow. - Config schema —
openclaw.plugin.jsonhas an empty configSchema. Should define token, webhookSecret, apiBase, allowFrom, groups, etc. - Threading — Pachca has cross-chat threads (thread_id). The threading model needs mapping to OpenClaw's session routing, similar to how Telegram handles topics.
- Forms / Buttons — Pachca supports interactive forms and inline buttons. Not yet implemented.
- Tests — None yet.
- Streaming — Pachca doesn't support streaming natively. Need to decide: chunk messages or use edit-based streaming (edit the same message as tokens arrive).
- Pairing — The
notifyfunction in pairing is a no-op. - Runtime module injection — Following Telegram's pattern of lazy-loaded runtime modules (
loadTelegramSendModule, etc.) for tree-shaking.
channel.tsreferencesaccount.config.apiBasebutResolvedPachcaAccounthasapiBaseat top level — needs fix- No error recovery for failed webhook deliveries
- No retry logic for API calls
resolveTargetsis naive — returns input as-is without verifying the entity exists
Pachca differs from Telegram in key ways:
| Aspect | Telegram | Pachca |
|---|---|---|
| Inbound | Long-polling or webhook | Outgoing webhook only (platform POSTs to you) |
| File uploads | Send directly | 3-step: createUpload → PUT S3 → attach key |
| Threading | reply_to_message_id | Separate thread_id entity (cross-chat threads) |
| Bot auth | Bot token from @BotFather | Bearer token from workspace settings |
| Interactive | Inline keyboards | Forms + buttons |
| Message formatting | HTML | Markdown |
channels:
pachca:
token: "your-bot-access-token"
webhookSecret: "signing-secret-from-pachca"
apiBase: "https://api.pachca.com/api/v1" # optional, default shown
allowFrom: ["123", "456"] # user IDs allowed to DM the bot
dmPolicy: "allowlist" # allowlist | owner_only | open
groupPolicy: "allowlist" # allowlist | open
groups:
"789":
allowFrom: ["123"]
requireMention: trueContributions are welcome! This project is in early stages and there's plenty to do. Areas of particular interest:
- Webhook gateway integration (tying into OpenClaw's HTTP server)
- File upload 3-step flow
- Threading model
- Setup wizard
- Tests
Open an issue or PR. No strict rules yet — just be reasonable.
MIT