Python 3 Telegram API Bot to Send Messages to Telegram Users Using Telebot and Telethon Library Full Project For Beginners

You are currently viewing Python 3 Telegram API Bot to Send Messages to Telegram Users Using Telebot and Telethon Library Full Project For Beginners

 

Welcome folks today in this blog post we will be building a telegram bot which will be sending messages to telegram users in python using telebot and telethon library. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to install the following library using the pip command as shown below

 

pip install telebot

 

pip install telethon

 

After installing these libraries now we need to grab the api_id and api_hash for our telegram account as shown below

 

Go to Telegram Developer Account Website 

 

 

 

 

 

And now grab the api_id and api_hash values as shown above and store it somewhere we will use it inside the script

 

Now make an app.py file and copy paste the following code

 

app.py

 

 

 

Now inside the above script you need to replace three things which are as follows

 

api_id which you got earlier

 

api_hash which you got earlier

 

phone_no in international format with country code

 

After replacing all these things if you now execute the script by typing the below command as shown below

 

python app.py

 

 

Here it will send out a otp verification code to your telegram app so just write that code and after verification it will send out the messages to users

Leave a Reply