qbithelparr is a Discord bot that provides torrent status updates from qBittorrent. It can send notifications to both Discord channels.
- Discord Integration: Provides status updates on torrents directly in your Discord server.
- Torrent Status Updates: Shows the status of torrents, including downloading, completed, stalled, and more.
- Customizable: Configure categories and status types through a configuration file.
- Python 3.9+
- qBittorrent with Web UI enabled
- Discord Bot Token (with proper intents enabled)
- Discord Developer Mode enabled (to get channel IDs)
-
Clone the repository:
git clone https://github.com/Entree3k/qbithelparr cd qbithelparr -
Install the required Python packages:
pip install -r requirements.txt
-
Create your Discord bot:
- Go to Discord Developer Portal
- Create a new application
- Go to "Bot" section and create a bot
- Enable these intents: Message Content Intent, Server Members Intent
- Copy your bot token
- Invite the bot to your server with these permissions: Send Messages, Manage Messages, Read Message History
-
Configure
config.ini:- Edit the provided
config.inifile - Add your Discord bot token
- Add your Discord channel ID (right-click channel → Copy ID)
- Configure qBittorrent connection details
- Set category names to match your Sonarr/Radarr setup
- Edit the provided
-
Run the bot:
python qbithelparr.py
-
Interact with the bot on Discord using the
/statusslash command to get the status of torrents.
docker run -d \
--name qbithelparr \
--restart unless-stopped \
-e token="your_discord_bot_token" \
-e botChannel="your_discord_channel_id" \
-e QBIT_HOST="localhost" \
-e QBIT_PORT="8080" \
-e QBIT_USER="admin" \
-e QBIT_PASS="your_password" \
-e TV_CATEGORY="tv" \
-e MOVIE_CATEGORY="movies" \
-v /path/to/config:/usr/src/app \
entree3000/qbithelparr:latestCreate a docker-compose.yml file (see included example) and run:
docker-compose up -ddocker build -t qbithelparr .
docker run -d --name qbithelparr-container qbithelparr- Go to the Apps tab in Unraid
- Search for qbithelparr
- Fill in the configuration fields:
- Discord Bot Token
- Discord Channel ID
- qBittorrent host, port, username, password
- TV and Movie categories
- Click Apply
The container will automatically create a config.ini file at /mnt/user/appdata/qbithelparr/config.ini which you can edit and then restart the container.
- /status [filter]: Modern slash command to see the status of torrents.
/statusor/status all: See all torrents/status movies: See movie torrents only/status tv: See TV show torrents only/status completed: See completed torrents only/status downloading: See actively downloading torrents only/status tv completed: Combine filters to see completed TV shows/status movies downloading: See movies currently downloading
Note: The status message updates every 5 seconds for 30 seconds, then auto-deletes. Non-pinned messages in the channel are cleared when the command is used.
- Modern Discord.py 2.x: Updated from deprecated 1.7.3 to latest discord.py with slash commands
- Slash Commands: Native Discord slash command integration
- Comprehensive Error Handling: Graceful error handling throughout with user-friendly error messages
- Type Hints: Added type annotations for better code maintainability
- Better Documentation: Improved docstrings and inline comments
- Enhanced Configuration: Better documented config.ini with instructions
- Channel Validation: Bot now validates it's being used in the correct channel
- Improved Message Formatting: Better error handling for edge cases in message formatting
- Docker Support: Updated Dockerfile with proper volume mounting and output buffering
Feel free to submit issues or pull requests if you have suggestions or improvements.