Skip to content
pyed edited this page Jun 5, 2019 · 9 revisions

How to setup a new Telegram bot

First you need to have a Telegram account with a Username, It's a unique name that starts with @, You can set it in the settings area of your Telegram if you haven't already.

Next you go to speak with the @BotFather to make a new bot that you'll use to interact with Transmission, Send the command /newbot to the BotFather, He will ask you which name you want for your bot, choose anything you like, I will call mine Transmission for clarity.

Then he will ask you about the username you would like to choose for the bot, this username has to be unique and ends with bot.

After that you'll get a message with your new bot URL and an HTTP API token.

Start Shifting.

Now you just execute transmission-telegram and set the flag -token= to the bot's token, and the flag -master= to your own Telegram Username NOT the bot's username that ends with bot e.g.

transmission-telegram -token=294691344:AAE0YNeGDlKnwNPG6XcXOPCe4EG5xpLEdYY -master=Adam

if your Transmission is running on http://localhost:9091/transmission/rpc without requiring authentication, it will connect to it, you can now go to your bot and send /help to get a list of commands.

Possible flags:

  • -token= Bot token REQUIRED.
  • -master= Your Telegram username, so the bot will answer only to you, you can specify more than one master REQUIRED.
  • -url= Set to transmission's RPC url, it has to be the full url, starts with http and ends with /rpc.
  • -username= Transmission's RPC username.
  • -password= Transmission's RPC password.
  • -logfile= Write logs to a file instead of STDOUT.
  • -transmission-logfile= Point it to Transmission's log file to monitor torrents completion to notify upon them, Start transmission-daemon with the --logfile to get a log file.
  • -no-live A flag to turn off keeping the info live by updating some of the sent messages for a period of time, Helps if you're reaching some requesting limits.

Commands

These are the commands that will be available for you through the bot

  • list or li Lists all the torrents, takes an optional argument which is a query to list only torrents that has a tracker matches the query, or some of it.

  • head or he Lists the first n number of torrents, n defaults to 5 if no argument is provided.

  • tail or ta Lists the last n number of torrents, n defaults to 5 if no argument is provided.

  • down or dl Lists torrents with the status of Downloading or in the queue to download.

  • seeding or sd Lists torrents with the status of Seeding or in the queue to seed.

  • paused or pa Lists Paused torrents.

  • checking or ch Lists torrents with the status of Verifying or in the queue to verify.

  • active or ac Lists torrents that are actively uploading or downloading.

  • errors or er Lists torrents with with errors along with the error message.

  • sort or so Manipulate the sorting of the aforementioned commands, Call it without arguments for more.

  • trackers or tr Lists all the trackers along with the number of torrents.

  • add or ad Takes one or many URLs or magnets to add them, You can send a .torrent file via Telegram to add it.

  • search or se Takes a query and lists torrents with matching names.

  • latest or la Lists the newest n torrents, n defaults to 5 if no argument is provided.

  • info or in Takes one or more torrent's IDs to list more info about them.

  • stop or sp Takes one or more torrent's IDs to stop them. or all to stop all torrents.

  • start or st Takes one or more torrent's IDs to start them. or all to start all torrents.

  • check or ck Takes one or more torrent's IDs to verify them. or all to verify all torrents.

  • del Takes one or more torrent's IDs to delete them.

  • deldata Takes one or more torrent's IDs to delete them and their data.

  • stats or sa Shows Transmission's stats.

  • speed or ss Shows the upload and download speeds.

  • count or co Shows the torrents counts per status.

  • help Shows this a help message.

  • version Shows version numbers.

Notifications

To get a notification upon a torrent completion all you have to do is run your transmission-daemon with the --logfile flag to have a log file, and run transmission-telegram with the -transmission-logfile flag and point that to the transmission log file, upon the completion of any torrent it should send you a message.

Clone this wiki locally