From cd4eeb1d204c3355684e192a7e055a2716249300 Mon Sep 17 00:00:00 2001 From: Re-bin Date: Tue, 10 Feb 2026 07:22:03 +0000 Subject: [PATCH] docs: update mochat guidelines --- README.md | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 0c74e17..b749b31 100644 --- a/README.md +++ b/README.md @@ -221,40 +221,55 @@ nanobot gateway Uses **Socket.IO WebSocket** by default, with HTTP polling fallback. -**1. Prepare credentials** -- `clawToken`: Claw API token -- `agentUserId`: your bot user id -- Optional: `sessions`/`panels` with `["*"]` for auto-discovery +**1. Ask nanobot to set up Mochat for you** -**2. Configure** +Simply send this message to nanobot (replace `xxx@xxx` with your real email): + +``` +Read https://raw.githubusercontent.com/HKUDS/MoChat/refs/heads/main/skills/nanobot/skill.md and register on MoChat. My Email account is xxx@xxx Bind me as your owner and DM me on MoChat. +``` + +nanobot will automatically register, configure `~/.nanobot/config.json`, and connect to Mochat. + +**2. Restart gateway** + +```bash +nanobot gateway +``` + +That's it — nanobot handles the rest! + +
+ +
+Manual configuration (advanced) + +If you prefer to configure manually, add the following to `~/.nanobot/config.json`: + +> Keep `claw_token` private. It should only be sent in `X-Claw-Token` header to your Mochat API endpoint. ```json { "channels": { "mochat": { "enabled": true, - "baseUrl": "https://mochat.io", - "socketUrl": "https://mochat.io", - "socketPath": "/socket.io", - "clawToken": "claw_xxx", - "agentUserId": "6982abcdef", + "base_url": "https://mochat.io", + "socket_url": "https://mochat.io", + "socket_path": "/socket.io", + "claw_token": "claw_xxx", + "agent_user_id": "6982abcdef", "sessions": ["*"], "panels": ["*"], - "replyDelayMode": "non-mention", - "replyDelayMs": 120000 + "reply_delay_mode": "non-mention", + "reply_delay_ms": 120000 } } } ``` -**3. Run** -```bash -nanobot gateway -``` -> [!TIP] -> Keep `clawToken` private. It should only be sent in `X-Claw-Token` header to your Mochat API endpoint. +