- About
- Features
- Usage
- Parameters
- Environment variables from files (Docker secrets)
- Contributing
- Changelog
- License
The Transmission Discord Bot is a Python-based Discord bot built with the interactions.py framework. It seamlessly integrates with your Transmission BitTorrent client, empowering you to manage your downloads directly through Discord using intuitive slash commands. This user-friendly bot simplifies your torrent management experience, allowing you to effortlessly add
, remove
, list
, pause
, and resume
torrents without ever leaving your favorite Discord server.
- Torrent Management Made Easy: Interact with your Transmission BitTorrent client directly from Discord.
- Intuitive Slash Commands: Execute commands with the simple and familiar
/torrents
syntax. - Comprehensive Actions:
- Add: Add torrents by URL or magnet link, optionally specifying download directory.
- List: View a list of active torrents with progress information.
- Pause: Pause active torrents.
- Resume: Resume paused torrents.
- Remove: Remove torrents and optionally delete downloaded data.
- Informative Embeds: All bot responses are presented in visually appealing embeds for clarity and organization.
- Error Handling: Robust error handling ensures a smooth user experience and provides helpful feedback in case of issues.
- Logging: Detailed logging helps with troubleshooting and bot maintenance.
- Help Command: A dedicated
/torrents help
command provides clear instructions on how to use all bot functionalities.
For full documentation and examples, please refer to the Documentation.
Command | Description |
---|---|
/torrents add <url> [destination:<download_dir>] |
Add a torrent. |
/torrents list |
List torrents. |
/torrents pause <id> |
Pause a torrent. |
/torrents remove <id> |
Remove a torrent. |
/torrents resume <id> |
Resume a torrent. |
/torrents help |
Get help. |
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
---
services:
transmission-discord-bot:
container_name: transmission-discord-bot
image: demartini/transmission-discord-bot:latest
restart: unless-stopped
environment:
DISCORD_TOKEN: XXXXXXXXXX
SERVER_ID: XXXXXXXXXX
TRANSMISSION_HOST: localhost
TRANSMISSION_PORT: 9091
TRANSMISSION_USERNAME: admin
TRANSMISSION_PASSWORD: password
volumes:
- ./logs:/app/logs
docker run -d \
--name=transmission-discord-bot \
-e DISCORD_TOKEN= \
-e SERVER_ID= \
-e TRANSMISSION_HOST= \
-e TRANSMISSION_PORT= \
-e TRANSMISSION_USERNAME= \
-e TRANSMISSION_PASSWORD= \
-v /path/to/logs:/app/logs \
--restart unless-stopped \
demartini/transmission-discord-bot:latest
-
Clone the Repository:
git clone https://github.com/demartini/transmission-discord-bot
-
Install Dependencies:
-
Option 1: Using Poetry (Recommended):
cd transmission-discord-bot poetry install
-
Option 2: Without Poetry:
cd transmission-discord-bot python -m venv venv # Create a virtual environment (optional but recommended) source venv/bin/activate # Activate virtual env (Linux/macOS) or venv\Scripts\activate (Windows) pip install -r requirements.txt
-
-
Create a
.env
File:- Copy the provided
.env.example
file and rename it to.env
. - Fill in the required values in the
.env
file, including your Discord bot token and Transmission server details.
- Copy the provided
-
Start the Bot:
-
If using Poetry:
poetry shell # Optional: Activate the virtual environment (if not already active) poetry run python src/main.py
-
Without Poetry:
python src/main.py
-
Containers are configured using parameters passed at runtime (such as those above).
Parameter | Function |
---|---|
-e DISCORD_TOKEN |
Your Discord bot's token from the Developer Portal. |
-e SERVER_ID |
The Discord server ID where the bot should operate. |
-e TRANSMISSION_HOST |
The hostname or IP address of your Transmission server. (e.g., localhost). |
-e TRANSMISSION_PORT |
The port used by Transmission's RPC interface. (e.g., 9091). |
-e TRANSMISSION_USERNAME |
Your Transmission username if required. |
-e TRANSMISSION_PASSWORD |
Your Transmission password if required. |
-v /app/logs |
Logs directory in the container. |
You can set any environment variable from a file by using a special prepend FILE__
.
As an example:
-e FILE__MYVAR=/run/secrets/mysecretvariable
Will set the environment variable MYVAR
based on the contents of the /run/secrets/mysecretvariable
file.
If you are interested in helping contribute, please take a look at our contribution guidelines and open an issue or pull request.
See CHANGELOG for a human-readable history of changes.
Distributed under the MIT License. See LICENSE for more information.