Is your feature request related to a problem?
OpenClaw's Telegram channel hardcodes outbound Bot API calls to api.telegram.org. grammY natively supports a custom apiRoot via its constructor options, but OpenClaw doesn't expose this in channel config.
This blocks several legitimate use cases:
- Running a Telegram Bot API server locally for higher upload limits (up to 2GB) and faster file access
- Self-hosted Bot API for privacy-sensitive deployments
- Testing/development with mock Bot API servers
Describe the solution you'd like
Add channels.telegram.apiRoot (string, optional) that passes through to grammY's Api constructor as apiRoot. When unset, behaviour is unchanged (defaults to https://api.telegram.org).
{
channels: {
telegram: {
apiRoot: "http://localhost:8081",
botToken: "123:abc",
}
}
}
This should also work with multi-account configs:
{
channels: {
telegram: {
accounts: {
main: {
botToken: "123:abc",
apiRoot: "http://localhost:8081",
}
}
}
}
}
Implementation notes
grammY already supports this - it's a first-class option:
const bot = new Bot("token", {
client: { apiRoot: "http://localhost:8081" }
});
The change should be minimal - read the config value and pass it through to the Bot/Api constructor. Env fallback TELEGRAM_API_ROOT would be nice but not essential.
Describe alternatives you've considered
/etc/hosts redirect + TLS interception: works but fragile and requires disabling certificate validation
- Webhook-only workarounds: functional for inbound but don't cover outbound API calls
Additional context
Telegram officially supports self-hosted Bot API servers (tdlib/telegram-bot-api) and documents this as the standard way to lift file size limits and reduce latency. grammY's docs cover the client-side config under Bot API.
Is your feature request related to a problem?
OpenClaw's Telegram channel hardcodes outbound Bot API calls to
api.telegram.org. grammY natively supports a customapiRootvia its constructor options, but OpenClaw doesn't expose this in channel config.This blocks several legitimate use cases:
Describe the solution you'd like
Add
channels.telegram.apiRoot(string, optional) that passes through to grammY'sApiconstructor asapiRoot. When unset, behaviour is unchanged (defaults tohttps://api.telegram.org).This should also work with multi-account configs:
Implementation notes
grammY already supports this - it's a first-class option:
The change should be minimal - read the config value and pass it through to the Bot/Api constructor. Env fallback
TELEGRAM_API_ROOTwould be nice but not essential.Describe alternatives you've considered
/etc/hostsredirect + TLS interception: works but fragile and requires disabling certificate validationAdditional context
Telegram officially supports self-hosted Bot API servers (tdlib/telegram-bot-api) and documents this as the standard way to lift file size limits and reduce latency. grammY's docs cover the client-side config under Bot API.