Telegram Bot

You can add new torrents via Telegram bot.

Register bot

  1. Register your bot with BotFather as described in


If you have already configured notifications with Telegram you don’t need create a new bot. Use an existing one.

  1. Install python-telegram-bot library to your python environment with

    $ pip install python-telegram-bot

    You may install torrt with required dependencies with:

    $ pip install torrt[telegram]
  2. Configure torrt to use the bot:

    $ torrt configure_bot telegram token=YOUR_TOKEN

    Restricts users (comma-separated) talking to the bot with option allowed_users:

    $ torrt configure_bot telegram token=YOUR_TOKEN allowed_users=user1,user2
  3. Create a new Telegram group and add the bot.

Listen to commands

Start listening to user commands:

$ torrt run_bots

Now your bot is ready to accept messages and fully functional.


It is recommended to start run_bots process using a process management system (see supervisord or systemd configuration example below).

Talking to the bot

Bot supports a number of commands.

  1. To start new conversation with bot use command:


and follow further instructions. You can add new, list or remove already registered torrents.


If you want to cancel current operation use /cancel command.

  1. Add a torrent using /add command (torrent is downloaded to a default directory.):

  2. All registered torrents can be viewed with:

  3. To remove torrent use command:

  4. To show all available commands use:


Supervisor configuration

Here described how to configure and start torrt’s Telegram bot with supervisord.

  1. Install supervisord on your host as described at

  2. Create configuration file torrt.conf at /etc/supervisor/conf.d/:

    command=PATH_TO_TORRT_SCRIPT run_bots
Replace PATH_TO_TORRT_SCRIPT with a location of torrt executable file and USER_ON_HOST with a user starting a process.
  1. Start process with following commands:

    # supervisorctl reread
    # supervisorctl reload
    # supervisorctl start torrt

Systemd user service

If you are running basically any modern Linux distribution you can run Telegram bot under your user with systemd, without having to deal with global system configuration.

  1. Mark your user as the one allowed to ‘linger’

    # loginctl enable-linger `whoami`
  2. Create service definition in your home directory:

    $ mkdir -p ~/.config/systemd/user/
    $ echo << "EOF" > ~/.config/systemd/user/torrt.service
    Description=torrt bot
    ExecStart=PATH_TO_TORRT_SCRIPT run_bots

    Replace PATH_TO_TORRT_SCRIPT with a location of torrt executable file

  3. Start Service

    $ systemctl --user daemon-reload
    $ systemctl --user start torrt
  4. (Optional) Enable service autostart

    $ systemctl --user enable torrt