/AntennaTrelegram

Telegram bot - Retrieve, process and post one pic daily

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Antenna Trelegram

Antenna Trelegram is a Telegram bot that sends one picture to a mailing list of Telegram chats.

How it works

Each day at 8:30 am a job is triggered and the bot randomly retrieves an image from a private album on Imgur. This image is then processed by summing to it an overlay with a dinamically generated number, which is the number of days between the current date and 22/10/2017.

How to build

If you want to test it locally you have to make sure you have an account on Imgur with an album of any kind; you also have to register and authorize the application for your account, since Imgur uses OAuth2 (more info here).

You will also need Python installed (of course); then, follow these steps:

  • get the API key for your bot from the BotFather
  • setup a local environment with all the required variables (check the sample provided)
  • create the Python Virtualenv with py -m venv env or any name you like
  • install the dependencies with pip install -r requirements.txt (if it doesn't work try with pip3 install -r requirements.txt)
  • run with python bot.py

Disclaimer

This bot does make use of irony and was developed primarely for lighthearted humor in a private chat. No personal injury was inteded or even taken into account during development.

Tech Stack