This project is designed to optimize the performance of Telegram scripts, allowing you to manage multiple accounts efficiently using a single account.
In this code, only one account is active at any given time, which decreases server resource usage. The main bot (active bot) triggers actions or calls other accounts to perform tasks as needed. When the chosen channel posts something, the accounts comment on the channel with different scheduling times. You can add other actions or tasks as desired, and after that, you can submit a pull request (PR) on this repo.
- Handle multiple Telegram accounts from one interface.
- Efficiently schedule messages and interactions.
- Performance optimization for faster execution.
- Python 3.8 or higher
- Virtual environment (optional but recommended)
-
Clone the repository:
git clone https://github.com/norouzex/multi-telegram-bot-manager cd multi-telegram-bot-manager
-
Create and activate a virtual environment:
.\venv\Scripts\activate # For Windows source venv/bin/activate # For macOS/Linux```
-
Install the required dependencies:
pip install -r requirements.tx
-
Create a .env file in the root directory of the project and add your environment variables:
ADMIN_USERNAME="@your_admin_username" CHANNELS="channel1,channel2" MAIN_BOT_API_ID="your_bot_api_id" MAIN_BOT_API_HASH="your_bot_api_hash"
-
Create a bots_config.py file in the root directory of the project and add your bot configurations:
bots = [ { 'id': 'your_bot_id_1', 'hash': 'your_bot_hash_1', 'label': 'your_bot_label_1' }, { 'id': 'your_bot_id_2', 'hash': 'your_bot_hash_2', 'label': 'your_bot_label_2' }, # Add more bots as needed ]
To run the bot, execute the following command:
python main.py
If you would like to contribute to this project, please fork the repository and submit a pull request.