Welcome to the Telegram Message Forwarding Bot, a robust solution for forwarding messages, videos, and other media from users directly to the owner. This bot not only helps you manage incoming messages efficiently but also allows you to respond seamlessly.
- Forward Messages: Automatically forwards all types of messages from users to the owner.
- Reply Support: Replies sent by the owner are forwarded back to the respective users.
- Toggle Forwarding: Easily enable or disable message forwarding with the
/switch
command. - Status Check: Use the
/status
command to see if forwarding is currently enabled or disabled. - Logging: All actions are logged for future reference in a
message_log.json
file. - Error Handling: Automatically manages errors and attempts to reconnect if the bot crashes.
- Multi-Format Support: Handles text, photos, videos, documents, voice messages, and audio files.
- Python: Version 3.7 or higher.
- pip: Python package installer.
-
Clone the repository:
git clone https://github.com/DragAditya/Multi.git cd telegram-bot
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Configuration:
- Open the bot script file and replace the placeholders:
- Set your Telegram user ID in
OWNER_CHAT_ID
. - Set your bot token in
BOT_TOKEN
.
- Set your Telegram user ID in
- Open the bot script file and replace the placeholders:
Run the bot using:
python your_bot_script.py
Command | Description |
---|---|
/switch |
Toggles message forwarding on and off. |
/status |
Displays the current status of message forwarding. |
/help |
Provides a list of available commands. |
All actions performed by the bot are logged in message_log.json
. This file will be created in the root directory if it doesn't exist. You can review it for insights into the bot's operations and user interactions.
If you encounter issues while running the bot, consider the following steps:
- Check Bot Token: Ensure that your bot token is correct and has not been regenerated in the BotFather.
- Internet Connection: Verify your internet connection is stable.
- Python Environment: Ensure that all required packages are installed correctly. You can reinstall them with
pip install -r requirements.txt
. - Error Logs: Check the console output for error messages. The bot will attempt to log errors to help diagnose issues.
Contributions are welcome! If you have suggestions for improvements or features, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes and commit them (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- python-telegram-bot - The library used to interact with the Telegram Bot API.
- Special thanks to the open-source community for their invaluable contributions.
For further inquiries, feel free to reach out to me at:
- Email: waghaditya312@gmail.com
- GitHub: @DragAditya
Thank you for checking out this project! If you find it useful, please consider giving it a star ⭐.
### Key Enhancements Made:
- **Table of Contents**: Allows easy navigation through the document.
- **Section Breaks**: Divided content into clear sections with headers.
- **Usage Table**: Presented commands in a tabular format for better readability.
- **Troubleshooting Section**: Added common troubleshooting tips to assist users.
- **Acknowledgements Section**: Recognized the libraries and communities that contributed to the project.
- **Contact Information**: Provided a way for users to reach out for support or feedback.
### Instructions to Create the `README.md` File
1. **Open a text editor** of your choice (like Notepad, VSCode, or any IDE).
2. **Copy and paste** the above content into the editor.
3. **Replace placeholders** (like `yourusername`, `your.email@example.com`, and the image link) with your actual details.
4. **Save the file** as `README.md` in the root directory of your project.
This README provides a comprehensive overview of your project while maintaining an appealing and organized format. If you need further adjustments or additional sections, feel free to let me know!