Skip to content

Getting started

pyed edited this page Jun 30, 2017 · 1 revision

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 rTorrent, 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 rTorrent 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.

Kick it off.

Now you just execute rtelegram 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.

rtelegram -token=294691344:AAE0YNeGDlKnwNPG6XcXOPCe4EG5xpLEdYY -master=Adam

if you've rTorrent running with scgi_port = localhost:5000 in your rtorrent.rc file it will connect, you can now go to your bot and send /help to get a list of commands.

Flags

Required ones are bold.

  • -token= Bot token, Can be passed via environment variable RT_TOKEN.
  • -masters= Your Telegram username, so the bot will answer only to you, If you wish to define more than one master, separated them with commas e.g. -master=Adam,Jack
  • -url= rTorrent scgi_port, it defaults to localhost:5000, local_scgi can be used too.
  • -logfile= Write logs to a file instead of STDOUT.
  • -completed-torrents-logfile= Read Notifications.
  • -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 limits.

Known issues

  • If you send too many commands in a short period of time the bot may stop responding because Telegram has a limit on how many messages a bot is allowed to send in a given time frame, the -no-live flag can be used to go easy on that limit.
  • Only linux, macOS, Windows are supported for now.
Clone this wiki locally