/tgapi/bot{TOKEN}/{method} transparently forwards all requests to api.telegram.org.
Usage
Replace the Telegram API base URL in your backend:File downloads
A dedicated file download endpoint is available at/tgapi/file/bot{TOKEN}/{file_path}. This makes BotMux a drop-in replacement for Telegram’s file download URL, so you can configure it as your bot library’s base_file_url:
Cache-Control: public, max-age=86400 header.
Authentication
No additional auth required — the bot token in the URL is the authorization (same as Telegram API).Message capture
For send methods, the proxy extracts the sent message from the Telegram response and saves it to the database.Intercepted methods
Several Telegram Bot API methods are intercepted and handled by BotMux instead of being forwarded to Telegram:| Method | Behavior |
|---|---|
setWebhook | Configures the bot’s backend URL in BotMux and enables proxy mode. Auto-registers unknown bots via getMe. Supports url and drop_pending_updates parameters. |
deleteWebhook | Clears the backend URL and disables proxy mode. Supports drop_pending_updates. |
getWebhookInfo | Returns BotMux’s internal webhook state (url, pending_update_count, has_custom_certificate, max_connections, ip_address). |
getUpdates | When long polling is enabled, served from BotMux’s internal queue instead of forwarding to Telegram. When the bot is managed but long polling is not enabled, returns an empty result to prevent conflict errors. |
logOut | Returns {"ok": true, "result": true} without forwarding. Prevents token being disabled for 10 minutes. |
close | Returns {"ok": true, "result": true} without forwarding. Prevents the bot instance from being shut down on Telegram’s side. |