Adds JSON output mode for that returns QR code as base64 PNG data URL instead of terminal graphics. Useful for web dashboards and hosting platforms that need to display the QR in a browser. - Add --json and --timeout flags to channels login command - Use gateway.loginWithQrStart/Wait methods for JSON mode - Output two JSON objects: QR data, then connection result - Document new mode in docs/cli/channels.md
3.3 KiB
3.3 KiB
| summary | read_when | ||
|---|---|---|---|
| CLI reference for `moltbot channels` (accounts, status, login/logout, logs) |
|
moltbot channels
Manage chat channel accounts and their runtime status on the Gateway.
Related docs:
- Channel guides: Channels
- Gateway configuration: Configuration
Common commands
moltbot channels list
moltbot channels status
moltbot channels capabilities
moltbot channels capabilities --channel discord --target channel:123
moltbot channels resolve --channel slack "#general" "@jane"
moltbot channels logs --channel all
Add / remove accounts
moltbot channels add --channel telegram --token <bot-token>
moltbot channels remove --channel telegram --delete
Tip: moltbot channels add --help shows per-channel flags (token, app token, signal-cli paths, etc).
Login / logout (interactive)
moltbot channels login --channel whatsapp
moltbot channels logout --channel whatsapp
JSON mode (programmatic)
For programmatic use (e.g., web dashboards, hosting platforms), use --json to get QR data as JSON instead of terminal output:
moltbot channels login --channel whatsapp --json --timeout 60000
This outputs two JSON objects:
- Initial response with QR data:
{"status":"pending","qrDataUrl":"data:image/png;base64,...","message":"Scan this QR...","accountId":"default","channel":"whatsapp"}
- Final response after scan (or timeout):
{"status":"connected","connected":true,"message":"✅ Linked!","accountId":"default","channel":"whatsapp"}
The qrDataUrl is a base64-encoded PNG that can be displayed directly in an <img> tag.
Troubleshooting
- Run
moltbot status --deepfor a broad probe. - Use
moltbot doctorfor guided fixes. moltbot channels listprintsClaude: HTTP 403 ... user:profile→ usage snapshot needs theuser:profilescope. Use--no-usage, or provide a claude.ai session key (CLAUDE_WEB_SESSION_KEY/CLAUDE_WEB_COOKIE), or re-auth via Claude Code CLI.
Capabilities probe
Fetch provider capability hints (intents/scopes where available) plus static feature support:
moltbot channels capabilities
moltbot channels capabilities --channel discord --target channel:123
Notes:
--channelis optional; omit it to list every channel (including extensions).--targetacceptschannel:<id>or a raw numeric channel id and only applies to Discord.- Probes are provider-specific: Discord intents + optional channel permissions; Slack bot + user scopes; Telegram bot flags + webhook; Signal daemon version; MS Teams app token + Graph roles/scopes (annotated where known). Channels without probes report
Probe: unavailable.
Resolve names to IDs
Resolve channel/user names to IDs using the provider directory:
moltbot channels resolve --channel slack "#general" "@jane"
moltbot channels resolve --channel discord "My Server/#support" "@someone"
moltbot channels resolve --channel matrix "Project Room"
Notes:
- Use
--kind user|group|autoto force the target type. - Resolution prefers active matches when multiple entries share the same name.