#9577: feat: Add apiRoot option for custom Telegram Bot API server endpoint
channel: telegram
stale
Cluster:
Messaging Platform Improvements
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds a new `apiRoot` option to Telegram configuration, allowing OpenClaw to target a custom/self-hosted Telegram Bot API endpoint. The value is threaded through the Telegram bot creation (`src/telegram/bot.ts`), outbound send utilities (`src/telegram/send.ts`), and webhook management helpers (`src/telegram/webhook-set.ts`), and is added to both the config types (`src/config/types.telegram.ts`) and the zod config schema (`src/config/zod-schema.providers-core.ts`).
<h3>Confidence Score: 4/5</h3>
- This PR is largely safe to merge, but should tighten config validation for the new option to avoid runtime failures from invalid values.
- Changes are localized and consistently threaded through Telegram client construction paths. Main remaining concern is `apiRoot` being accepted as any string in the schema, which can allow invalid configs that only fail at runtime.
- src/config/zod-schema.providers-core.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13070: feat: Add support for custom Telegram Bot API server URL via apiRoo...
by vfiee · 2026-02-10
90.3%
#19616: feat(telegram): support custom apiRoot for Telegram Bot API
by CarloCPP · 2026-02-18
87.8%
#18170: feat(telegram): support local Bot API server via `apiRoot` config
by iemesowum · 2026-02-16
77.3%
#7058: feat(telegram): add channel_post handler for broadcast channels
by waifu7498173 · 2026-02-02
76.8%
#21029: Feature/telegram bot avatar clean
by aleonnet · 2026-02-19
76.5%
#8310: feat(telegram): Add allowBots support for groups (parity with Disco...
by vishaltandale00 · 2026-02-03
76.1%
#6457: fix(telegram): register commands for group scope + preserve topic t...
by dae-sun · 2026-02-01
74.8%
#7611: fix: migrate channels.telegram.token to botToken on config load
by luiginotmario · 2026-02-03
74.5%
#11347: fix: scope Telegram update offset to bot token
by anooprdawar · 2026-02-07
74.4%
#7754: fix(telegram): configurable webhook timeout
by djmango · 2026-02-03
73.9%