This tool monitors specified Telegram channels for messages that contain certain keywords and forwards them to a private channel. It's built using Python and Telethon, a Telegram client library.
## Features
- Monitors multiple channels.
- Searches for messages with specified keywords.
- Forwards matching messages to a private channel.
## Prerequisites
Before you can use this tool, you need to set up a few things:
1. **Python 3.8+** (Tested only on 3.12)
2. **Telethon Library**
3. **A Telegram API key and API Hash**
4. **A Telegram Bot**
5. **A Private Telegram Channel**
### Installing Python
Download and install Python from [python.org](https://www.python.org/downloads/).
## Setup Instructions
### Obtaining Telegram API ID and Hash
1. **Login to your Telegram account** at [Telegram Core](https://my.telegram.org).
2. Go to `API development tools` and fill out the form.
3. You will get an `api_id` and `api_hash` which are needed for the tool.
### Creating a Telegram Bot
1. **Open Telegram** and search for [BotFather](https://t.me/botfather).
2. Send `/newbot` and follow the instructions to create your bot.
3. **Copy the token** provided by BotFather.
### Setting Up a Private Channel
1. **Create a new channel** in Telegram.
2. **Switch the channel's privacy to private** in the channel settings.
3. **Add your bot as an administrator** to the channel.
## Configuration Files
The script uses several files for configuration:
- `credentials.json`: Automatically created if not present. It stores API keys, bot token, and private channel ID.
- `keywords.txt`: Contains keywords to monitor. Supports special modifiers for dynamic matching:
- `*` at the end allows up to three additional characters.
- `**` allows up to six additional characters.
- `#` at the start includes numeric characters (up to three).