Collect all incoming messages in a dedicated Telegram channel
Warning Abusing the API capabilities may lead to your Telegram account being blocked
The project uses a config.json file with the following data:
{
"API_ID": "<YOUR_VALUE>",
"API_HASH": "<YOUR_VALUE>",
"CHAT_ID": "<YOUR_VALUE>"
}
To get the API_ID
and API_HASH
for your Telegram application, follow these steps:
- Go to the Telegram API Portal.
- Login with your phone number.
- Click on the API development tools link.
- Click on the Create New Application button.
- Fill in the required fields and click on the Create button.
- Your
API_ID
andAPI_HASH
will be displayed on the next page.
To get the CHAT_ID
of a channel in Telegram, you can use the @username_to_id_bot
. Follow these steps:
- Forward a message from the channel you want to get the
CHAT_ID
for to the@username_to_id_bot
. - The bot will send you a message with the
CHAT_ID
of the channel.
To use this project, clone the repository and install the required dependencies:
- Copy code
git clone https://github.com/<your_username>/TelegramMessageCollector.git
cd TelegramMessageCollector
pip3 install -r requirements.txt
- Then, edit the
config.json
file with yourAPI_ID
,API_HASH
, andCHAT_ID
.
Finally, run the script:
python3 ./src/run.py