mirror of
https://github.com/NohamR/TransmissionBot.git
synced 2025-05-24 14:22:00 +00:00
6.5 KiB
6.5 KiB
Transmission Discord Bot
A python Discord bot for controlling an instance of Transmission, the torrent client, using the transmissionrpc python library. This bot is built on kkrypt0nn's bot template and adapted from leighmacdonald's transmission scripts.
Features
- Completely self-contained: Get the python dependencies, configure a single python file, and run
- Complete management of transfers:
t/add URL
Add new torrent transfers via URL to torrent file or magnet linkt/list [OPTIONS]
List existing transfers with filtering, sorting, and searching transfer names with regular expressions or transfer ID(s)t/modify [OPTIONS]
Modify (pause, resume, remove, remove and delete, or verify data) transfer(s) specified usinglist
's optionst/summary
Print simple summary of all transfers
- User-friendly and attractive interface
- In-channel documentation using
t/help [COMMAND]
- Use of
embeds
where appropriate - Uses reactions in lieu of text input where appropriate
- Output automatically formatted to look good on desktop/mobile clients
- Can toggle override using
t/compact
- Can toggle override using
- Auto-update output for
summary
andlist
commands- Simultaneous auto-update output messages supported
- An auto-update output message can be reprinted to the bottom of the channel by clicking its "🖨" reaction
- In-channel documentation using
- User whitelist and blacklist to control access
- Channel list to limit access to specified channel(s)
Example images
- Transfer summary (and symbol legend)
- Modifying existing transfers
Install
- Get Transmission and setup its web interface
- Install python 3, transmissionrpc, and discord.py
- Clone this repository using
git clone https://github.com/twilsonco/TransmissionBot
Configure
- Setup your new bot on Discord:
- Sign up for a Discord developer account
- Go to the developer portal, click New Application, pick a name and click Create
- Note the
CLIENT ID
- Note the
- Click on Bot under SETTINGS and then click Add Bot
- Fill out information for the bot and uncheck the
PUBLIC BOT
toggle- Note the bot
TOKEN
- Note the bot
- Invite the bot to your server
- Go to
https://discordapp.com/api/oauth2/authorize?client_id=<client_id>&scope=bot&permissions=<permissions>
- replace
<client_id>
with theCLIENT ID
from above - replace
<permissions>
with the minimum permissions92224
(for send messages, manage messages, embed links, read message history, and add rections) or administrator permissions9
to keep things simple
- replace
- Invite the bot to your server
- Go to
- Configure
bot.py
- Set discord options
TOKEN
to your bot secret token- Lists of
OWNERS
,BLACKLIST
and/orWHITELIST
users, andCHANNEL_IDS
on which the bot should listen for commands- get these ids by enabling developer mode in your Discord client and right-clicking on a user/channel
- Pick a
BOT_PREFIX
(default ist/
)
- Set Transmission client information
TSCLIENT_CONFIG
points to the Transmission web interface you already setup- Set
DRYRUN
toTrue
to enable the discord bot to actually make changes to existing transfers - Pick a location for the logfile on line 45
- Optionally disable logging by setting the log level to
logger.CRITICAL
which isn't used anywhere
- Set discord options
- Run with
python3 /path/to/TransmissionBot/bot.py
and enjoy!
To-do (implemented)
- Command to print detailed information for transfer(s)
- Complete connection information
- Lists of transfer files, peers, trackers
Add ability to verify transfer data- When searching by name, update regex to include potential accented characters, eg
pokemon
would also matchpokémon
- Specify number of transfers to show when using
list
ormodify
- Combine the
list
andmodify
commands in the code, with a simple parameter to specify whether or not modification is allowed - Currently, searching by name is done with case-insensitive regex. Update to that if a user includes upper case characters, case-sensitive search is performed
Add recurring list option. Ie every five seconds replace(also did this forlist
output with fresh output. This would be done by reacting to a "repeat" emoji to initiate repetition of the current searchsummary
)Add additional filtering options: stalled, error, non-zero up/down rate.- Add shorthand for filtering options (downloading/seeding/stalled/paused become d/s/i/p etc., that's i for "idle" since s is for seeding)
- Add a
top
command that'sessentially a combination of the up/down rate filter and the repeating output features - Ability to refine
list
output with filter or sort using reactions; ie click a filter or sort reaction which triggers another message with additional reactions to click to apply the extra filters or sort - Ability to specify which files to include in download (we'll see about that; sounds clunky but maybe using file ID specifiers e.g.
1,3-5,8
) - Notifications for when a transfer finishes/stalls/errors
- via DM to the user that added the transfer
- or by posting to the channel from which a transfer was added
- Let other users opt to receive notifications for transfers they didn't add
- Post-download file management (never going to happen...)
- Compress files (encrypted) and make available for direct download from server via download link posted to channel or DM'd to user
- Use JSON config file so that updating is non-destructive
- Add
set
command so owners can edit configuration through Discord Add a toggle for minimalised output for better display on mobile devices. Toggle usingt/compact
as standalone command or by clicking a 📱 reaction. Store as global variable so all commands output can be affected.
Author(s)
- Tim Wilson
Thanks to:
- kkrypt0nn
- leighmacdonald
License
This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details