docs: update mochat guidelines
This commit is contained in:
parent
ccf3896a5b
commit
cd4eeb1d20
51
README.md
51
README.md
@ -221,40 +221,55 @@ nanobot gateway
|
|||||||
|
|
||||||
Uses **Socket.IO WebSocket** by default, with HTTP polling fallback.
|
Uses **Socket.IO WebSocket** by default, with HTTP polling fallback.
|
||||||
|
|
||||||
**1. Prepare credentials**
|
**1. Ask nanobot to set up Mochat for you**
|
||||||
- `clawToken`: Claw API token
|
|
||||||
- `agentUserId`: your bot user id
|
|
||||||
- Optional: `sessions`/`panels` with `["*"]` for auto-discovery
|
|
||||||
|
|
||||||
**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!
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Manual configuration (advanced)</summary>
|
||||||
|
|
||||||
|
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
|
```json
|
||||||
{
|
{
|
||||||
"channels": {
|
"channels": {
|
||||||
"mochat": {
|
"mochat": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"baseUrl": "https://mochat.io",
|
"base_url": "https://mochat.io",
|
||||||
"socketUrl": "https://mochat.io",
|
"socket_url": "https://mochat.io",
|
||||||
"socketPath": "/socket.io",
|
"socket_path": "/socket.io",
|
||||||
"clawToken": "claw_xxx",
|
"claw_token": "claw_xxx",
|
||||||
"agentUserId": "6982abcdef",
|
"agent_user_id": "6982abcdef",
|
||||||
"sessions": ["*"],
|
"sessions": ["*"],
|
||||||
"panels": ["*"],
|
"panels": ["*"],
|
||||||
"replyDelayMode": "non-mention",
|
"reply_delay_mode": "non-mention",
|
||||||
"replyDelayMs": 120000
|
"reply_delay_ms": 120000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**3. Run**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nanobot gateway
|
|
||||||
```
|
|
||||||
|
|
||||||
> [!TIP]
|
</details>
|
||||||
> Keep `clawToken` private. It should only be sent in `X-Claw-Token` header to your Mochat API endpoint.
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user