refactor(whatsapp): replace bridge with neonize

This commit is contained in:
chengyongru
2026-06-27 11:05:03 +08:00
committed by Xubin Ren
parent 3460ca3cb9
commit 2a9e288dfe
18 changed files with 998 additions and 1438 deletions
+26 -15
View File
@@ -303,9 +303,15 @@ nanobot gateway
<details>
<summary><b>WhatsApp</b></summary>
Requires **Node.js ≥18**.
Requires the WhatsApp optional dependencies:
**1. Link device**
```bash
pip install "nanobot-ai[whatsapp]"
# Source checkout:
python -m pip install -e ".[whatsapp]"
```
**1. Link device with QR**
```bash
nanobot channels login whatsapp
@@ -319,30 +325,35 @@ nanobot channels login whatsapp
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+1234567890"]
"allowFrom": ["1234567890"]
}
}
}
```
**3. Run** (two terminals)
Optional session database path:
```bash
# Terminal 1
nanobot channels login whatsapp
# Terminal 2
nanobot gateway
```json
{
"channels": {
"whatsapp": {
"databasePath": "~/.nanobot/whatsapp-auth/neonize.db"
}
}
}
```
> WhatsApp bridge updates are not applied automatically for existing installations. After upgrading nanobot, rebuild the local bridge with:
> `rm -rf ~/.nanobot/bridge && nanobot channels login whatsapp`
**3. Run**
```bash
nanobot gateway
```
**Optional: static LID mappings**
Modern WhatsApp can deliver a sender's LID instead of their phone number. nanobot
learns the LID→phone mapping at runtime (and reuses the ones the bridge persists on
disk), but you can also seed mappings up front so the phone number resolves from the
learns LID to phone mappings at runtime when both identifiers are present, but you
can also seed mappings up front so the phone number resolves from the
very first message:
```json
@@ -350,7 +361,7 @@ very first message:
"channels": {
"whatsapp": {
"enabled": true,
"allowFrom": ["+1234567890"],
"allowFrom": ["1234567890"],
"lidMappings": { "123456789012345": "1234567890" }
}
}
+2 -3
View File
@@ -326,11 +326,10 @@ python -m pip install -e .
nanobot --version
```
If you use WhatsApp, rebuild the local bridge after upgrading:
If you use WhatsApp from a source checkout, keep the optional dependencies installed:
```bash
rm -rf ~/.nanobot/bridge
nanobot channels login whatsapp
python -m pip install -e ".[whatsapp]"
```
## First-Run Troubleshooting