Telegram bot
Run your own Telegram bot powered by Azot: send it a video link in a private chat or a group, and it downloads the media as MP4 and sends the file back in chat.
Running a Telegram bot requires Azot Pro. You can run it from the desktop app (Settings > Telegram bot) while Azot is open, or headlessly with azot serve telegram.
1. Create a bot token
- Open @BotFather in Telegram and run
/newbot. - Choose a name and username for your bot.
- Copy the HTTP API token BotFather gives you.
2. Configure and start the bot
Desktop app
Open Settings > Telegram bot:
- Paste your token into Bot token.
- Turn on the bot switch at the top of the page.
- Send any message to your bot in Telegram. Because nobody is allowed yet, the bot replies with your numeric Telegram ID and logs a quick Allow button in the Activity section.
- Click Allow in Activity (or enter user IDs or negative group IDs under Access > Allow ID).
Command line (headless)
- Sign in to your Azot Pro account:
azot login- If you do not know your numeric Telegram ID yet, start the bot once without
--allow, send it a private message in Telegram to receive your ID, and stop the bot withCtrl+C:
AZOT_TG_TOKEN="123456:ABC-DEF..." azot serve telegram$env:AZOT_TG_TOKEN = "123456:ABC-DEF..."
azot serve telegram- Restart the bot with your user ID (or negative group ID) using
azot serve telegram(aliasazot serve tg):
AZOT_TG_TOKEN="123456:ABC-DEF..." azot serve telegram --allow 123456789$env:AZOT_TG_TOKEN = "123456:ABC-DEF..."
azot serve telegram --allow 123456789You can also pass --token instead of AZOT_TG_TOKEN.
| Flag | Description |
|---|---|
--token <token> | Bot token from @BotFather (defaults to AZOT_TG_TOKEN) |
--allow <ids> | Comma-separated Telegram IDs: positive user IDs allow a person anywhere, negative group IDs allow everyone in that group, * allows anyone |
-q, --quality <q> | Video quality such as 720p or 1080p (lower quality stays under Telegram's 50 MB limit more often) |
--caption | Send the video title as the message caption |
--proactive | In groups, automatically download supported links from any message without /get |
--keep-files | Keep downloaded files in your download folder after sending them in private chats (group files are always deleted after sending) |
--api-url <url> | Local Telegram Bot API server URL, raising the upload limit from 50 MB to 2000 MB |
Only one process per bot token
Do not run the desktop Telegram bot and azot serve telegram with the same bot token at the same time. Telegram rejects competing pollers with a conflict error.
Using the bot in chats
Send links that resolve to a single video. The bot rejects links that contain multiple videos, such as playlists or multi-episode pages.
- Private chat: send a link to one video directly. The bot replies with a status message while downloading and uploading, then replaces it with the video.
- Group chat: send
/get <link>, or reply/getto a message containing a link. - Proactive mode in groups: turn on Links in groups (desktop) or pass
--proactive(CLI) to download any link handled by an installed extension without typing/get. First turn off Group Privacy in@BotFather(/setprivacy->Disable), then re-add the bot to the group or make it a group admin.
Each sender runs one bot download at a time. Downloads made by the bot also appear in Azot's shared download list while they run.
Upload size limit (50 MB vs 2000 MB)
Telegram's official Bot API caps bot uploads at 50 MB. If a video is larger, lower the bot's quality (for example to 720p or 480p), or run a local Telegram Bot API server and point Bot API server (--api-url) to it to upload files up to 2000 MB.