This repository contains a Python script that sends personalized Telegram messages to users using their phone numbers. The script reads names and phone numbers from an Excel file (list_of_people.xlsx
) and sends each person a customized invitation message.
- Reads recipient data from an Excel file
- Sends personalized messages to recipients via Telegram
- Supports Markdown formatting for messages
- Python 3.x
- A Telegram account
- Telegram API credentials (API ID and API hash)
-
Clone the repository:
git clone https://github.com/berdyh/Telegram-Personalized-Message-Sender.git cd telegram-message-sender
-
Install the required Python packages:
pip install pandas telethon openpyxl
-
Create a Telegram application to get your API ID and API hash. You can do this at my.telegram.org.
-
Rename the
config_example.py
file toconfig.py
:mv config_example.py config.py
-
Open the
config.py
file and update it with your Telegram API credentials and your phone number:class Config: API_ID = 'your_api_id' API_HASH = 'your_api_hash' PHONE = 'your_telegram_phone_number'
The script reads recipient data from list_of_people.xlsx
. Ensure the file has the following columns:
- First Name
- Last Name
- Phone Number
Example:
First Name | Last Name | Phone Number |
---|---|---|
John | Doe | 1234567890 |
Jane | Smith | 9876543210 |
To run the script and send messages:
python send_messages.py
(built with the assistance of ChatGPT)