fix(telegram): expose proxy setup in WebUI (#5033)

This commit is contained in:
chengyongru
2026-07-23 14:18:49 +08:00
committed by GitHub
parent 3647875aba
commit 01cdfc8100
17 changed files with 472 additions and 24 deletions
+33 -1
View File
@@ -109,7 +109,24 @@ If `nanobot channels status` does not show the channel as enabled, the config sn
<details>
<summary><b>Telegram</b></summary>
**Install the optional channel dependency**
**Recommended WebUI setup**
1. Create a bot with `@BotFather` and copy its token.
2. Run `nanobot webui`, then open **Settings → Channels → Telegram**.
3. Paste the token. If the gateway cannot reach Telegram directly, expand
**Advanced** and add an HTTP or SOCKS proxy.
4. Save and enable Telegram, then send the bot a direct message.
The configuration badge means nanobot found a saved token. The live connection
check is separate, so a temporary Telegram or proxy outage does not make an
existing configuration disappear. Saved tokens and proxy URLs remain masked.
See the [step-by-step Telegram guide](./guides/telegram-ai-agent.md) for pairing
and troubleshooting.
**Manual setup**
Install the optional channel dependency:
```bash
nanobot plugins enable telegram
@@ -134,6 +151,21 @@ nanobot plugins enable telegram
}
```
If the gateway cannot reach Telegram directly, add a proxy to the same section:
```json
{
"channels": {
"telegram": {
"proxy": "http://127.0.0.1:7890"
}
}
}
```
HTTP, HTTPS, SOCKS5, and SOCKS5H proxy URLs are accepted. Treat a proxy URL
containing a username or password as a secret.
> You can find your **User ID** in Telegram settings. It is shown as `@yourUserId`. Copy this value **without the `@` symbol** and paste it into the config file.
>
> `richMessages` defaults to `false`. Set it to `true` only if your Telegram client supports Bot API 10.1 rich messages and you want richer markdown rendering; keep it disabled for Telegram Web, which may show unsupported-message errors for rich messages.