Telegram Bot

build with: | Python | Telegram | AWS | Serverless | Node.js

Situation

Imagine you have carefully created hundreds of flashcards to learn concepts and theories in Machine Learning or any other field but rarely have the incentive to actually sit down and study them. A better and more effective way to study your flashcards would be if you would be constantly reminded that they exist by getting a couple of them send right on your phone each day. We always check our phones and messages, so why not include flashcards right where we spend a lot of time?

This is the purpose of this simple telegram bot! It sends a random flashcard every morning and evening to a designated chat group in telegram and thereby ensures that you get constantly reminded to study the content piece by piece.

Solution: How we programmed a bot that sends a random flashcard to your chat group twice a day

The bot is build in a way that you do not necessarily need to use it to send flashcards but, in fact, can be used for any image that you would like to send to a chat group.

We built the bot in python and used the python-telegram-bot API. What it essentially does is, it randomly picks an image file in a locally stored folder and sends it to a designated chat group in telegram.

To trigger and automate this process, we use AWS Lambda using the serverless framework to schedule when the image is sent. At the moment, this is set to send a random flashcard twice a day – one in the morning at 6am UTC and another at 6pm UTC. These times are highly flexible and can be adjusted to different times, rates at which images are sent to even select specific days (e.g., Monday through Friday only).

For a detailed guide on how we programmed the telegram bot and how it can be used by yourself, take a look at the GitHub repository of this project.

Avatar
Dennis Hammerschmidt
PhD Candidate | Data Scientist

I’m a PhD Candidate in Political Science working with all sorts of data sources across different statistical methods (NLP, networks, and ML) to understand and quantify the structure of international relations.

Related