- It's a pre-built docker image of tdlib/telegram-bot-api.
- Different tags are also available, based on the version of tdlib/telegram-bot-api.
- Auto-Update:
- It updates automatically, when tdlib/telegram-bot-api is updated.
- Updates are checked everyday 12:00 PM IST (6:30 AM UTC).
- Add PAT (with repo, user and workflow permissions) to
WORKFLOW_PAT
action secret, if you want to auto-deploy to docker-hub when update is fetched. (applicable only when you fork this repository)
Obtain api-id
& api-hash
as described here and specify them using TELEGRAM_API_ID
& TELEGRAM_API_HASH
environment variables.
TELEGRAM_API_ID
TELEGRAM_API_HASH
EXTRA_ARGS
: Extra arguments fortelegram-bot-api
. Ex:<ARG1> <ARG2> <ARG3>
.
TG_VERSION
: You can set theTG_VERSION
env using this ARG, on build time.
- All above envs (if passed)
DEFAULT_ARGS
: Default args for running telegram-bot-api.TELEGRAM_WORK_DIR
: read hereTELEGRAM_TEMP_DIR
: read hereMACHINE_USERNAME
: read hereMACHINE_GROUPNAME
: read herePORT1
: read herePORT2
: read hereTG_VERSION
: Version of telegram-bot-api and docker-image.
8081/tcp
(default for telegram-bot-api)8082/tcp
- There are many ways to run it. Some are:
- Running using
docker run
. - Deploying to some hosting service directly.
- Using it as the base image in your docker container.
- Ex:
FROM sayyid5416/telegram-bot-api:latest
- Ex:
- Check docker-entrypoint.sh to get an idea of how to run it.
- Ex:
telegram-bot-api <Default-Arguments> <Extra-Arguments>
- Ex:
- Running using
-
Default-Arguments: Already configured in Dockerfile as
DEFAULT_ARGS
.Argument Default value Description --api-id=<value> Set it via ENV "TELEGRAM_API_ID" For Telegram API access --api-hash=<value> Set it via ENV "TELEGRAM_API_HASH" For Telegram API access -p, --http-port=<value> PORT1 (8081) HTTP listening port -d, --dir=<value> TELEGRAM_WORK_DIR (/file) Server working directory -t, --temp-dir=<value> TELEGRAM_TEMP_DIR (/tmp) Directory for storing HTTP server temporary files -u, --username=<value> MACHINE_USERNAME (telegram-bot-api) user name to switch to -g, --groupname=<value> MACHINE_GROUPNAME (telegram-bot-api) Effective group name to switch to
-
Extra-Arguments: Pass these via
EXTRA_ARGS
environment variable.Argument Default value Description --local NA Allow the Bot API server to serve local requests -s, --http-stat-port=<value> NA HTTP statistics port --filter=<value> NA "<remainder>/<modulo>". Allow only bots with 'bot_user_id % modulo == remainder' --max-webhook-connections=<value> NA Default value of the maximum webhook connections per bot --http-ip-address=<value> All IPv4 addresses local IP address, HTTP connections to which will be accepted --http-stat-ip-address=<value> All IPv4 addresses local IP address, HTTP statistics connections to which will be accepted -l, --log=<value> NA Path to the file where the log will be written -v, --verbosity=<value> NA Log verbosity level --memory-verbosity=<value> 3 Memory log verbosity level --log-max-file-size=<value> 2000000000 Maximum size of the log file in bytes before it will be auto-rotated -c, --max-connections=<value> NA Maximum number of open file descriptors --proxy=<value> NA HTTP proxy server for outgoing webhook requests in the format http://host:port
-
Moving a bot to a local server or Moving a bot from one local server to another:
- You must call logOut on your bot, to deregister your bot from previous server, before using this server.
-
Using a Local Bot API Server (
--local
): -
More Info:
- Your own API endpoint, Ex:
<hostUrl>/bot<token>/getMe
. - Telegram Bot API server accepts only HTTP requests, so a TLS termination proxy needs to be used to handle remote HTTPS requests.
- Your own API endpoint, Ex: