Skip to content

telegram bot api

stefano edited this page Nov 27, 2025 · 1 revision

hosting your own telegram bot api can help you avoid limits on file sizes and improve performance when downloading media through the bot.

you can either host your own bot api using the official telegram bot api source code or use other third-party implementations.

recommended

setup

since govd uses an internal network with docker, you can either:

  • add the bot api service to the existing docker-compose.yaml file.
  • create a shared network and connect both the bot api and govd services to it.

here's an example with a shared network:

docker network create govd-shared

start your bot api container connected to the shared network. for example, using tdlight/tdlightbotapi:

docker run -d --name bot-api \
  -e TELEGRAM_API_ID=123 \
  -e TELEGRAM_API_HASH=YOUR_API_HASH \
  -p 8081:8081 \
  --network govd-shared \
  tdlight/tdlightbotapi

modify the docker-compose.yaml file to connect to the shared network:

services:
  bot:
    ...
    networks:
        - govd-network
        - govd-shared
...
networks:
  govd-network:
    driver: bridge
  govd-shared:
    external: true

update your environment variable in the .env file to point to your bot api service:

BOT_API_URL=http://bot-api:8081

Clone this wiki locally