Member-only story
How I made my first advanced telegram bot using python
In this blog, I am going to show you how I built my first advanced Telegram bot with python and deployed it on Heroku for free. The bot that we are going to create together aims to download any YouTube URL that the user sends to the bot and upload it in the chat!
I know it might sound a little too complicated to do but believe me, it’s not! This is How our Telegram bot will look like at the end of this blog.
The setup
In your project directory add the following files.
bot.py
requirements.txt
Procfile
The bot.py file as you may guess from its name is the python file in which we will code the logic of our bot. On the other hand, the requirements.txt file, as well as the Procfile, are the files that are needed for deploying the bot on Heroku servers. I will later discuss what each of these two files are responsible for. Note that the Procfile has no extension!
Programming the bot
As a starter, we will follow a raw template of a Telegram bot as shown below and build up our application on it.