A powerful Telegram bot that renames files, videos, and documents with custom thumbnails and advanced media processing capabilities.
Features β’ Installation β’ Configuration β’ Usage β’ Deployment
RenameBot is a feature-rich Telegram bot designed to help users rename their media files effortlessly. With support for videos, documents, custom thumbnails, and quality optimization, this bot provides a seamless file management experience directly in Telegram.
Whether you need to rename files, compress thumbnails, or batch process media, RenameBot has you covered with an intuitive interface and powerful backend.
- π File Renaming - Rename videos and documents with custom names
- πΌοΈ Custom Thumbnails - Set and manage custom thumbnail images
- π₯ Media Processing - Download, process, and upload files seamlessly
- β‘ Progress Tracking - Real-time progress bars for all operations
- π Secure Operations - Safe file handling with automatic cleanup
- π Batch Processing - Process multiple files efficiently
- π¨ Thumbnail Optimization - Automatic image compression and resizing
- πΎ Smart Storage - Temporary file management with auto-cleanup
- π οΈ Customizable Settings - Configurable download directory and quality settings
- π± User-Friendly Interface - Intuitive inline buttons and clear instructions
/start- Check bot status and get started/help- View available commands and features/report- Report issues to the bot administrator/stats- View system statistics and resource usage
- Python 3.11 or higher
- Telegram Bot Token (BotFather)
- Telegram API credentials (my.telegram.org)
- MongoDB database (MongoDB Cloud) - Optional
- Clone the Repository
git clone https://github.com/OnlyNoco/RenameBot.git
cd RenameBot- Install Dependencies
pip install -r requirements.txt- Configure the Bot
cp sample_config.py config.py
# Edit config.py with your credentials- Run the Bot
python main.pyCreate a config.py file based on sample_config.py with the following variables:
| Variable | Type | Description |
|---|---|---|
BOT_TOKEN |
string | Your Telegram bot token from BotFather |
API_ID |
integer | Telegram API ID from my.telegram.org |
API_HASH |
string | Telegram API Hash from my.telegram.org |
OWNER_ID |
integer | Your Telegram user ID (admin) |
WORKER |
integer | Number of worker threads (default: 4) |
PORT |
integer | Port for web server (default: 8080) |
DB_URL |
string | MongoDB connection URL |
DB_NAME |
string | MongoDB database name |
DOWNLOAD_DIR |
string | Directory for temporary downloads (default: ./downloads) |
START_MSG |
string | Custom welcome message |
ABOUT_MSG |
string | About bot message |
CMD_MSG |
string | Commands help message |
START_PIC |
list | URLs for start command media |
BOT_TOKEN = "your_bot_token_here"
API_ID = 26254064
API_HASH = "your_api_hash_here"
OWNER_ID = 5296584067
WORKER = 4
PORT = 8080
DB_URL = "mongodb+srv://username:password@cluster.mongodb.net"
DB_NAME = "RenameBot"
DOWNLOAD_DIR = "./downloads"-
Start the Bot
- Use
/startto initiate the bot and see the welcome message
- Use
-
Send a File
- Send a video or document file to the bot
- The bot will ask for a custom filename
-
Set Thumbnail
- Send an image to the bot in private chat
- The bot will save it as your custom thumbnail
-
Rename Files
- Send media with the custom thumbnail already set
- Reply with the desired filename (without extension)
- Choose between
documentorvideoformat - The bot will process and send the renamed file
-
Get Help
- Use
/helpto view all available commands - Use
/reportto report issues to the admin
- Use
1. /start β Bot sends welcome message
2. Send photo β Bot saves as thumbnail
3. Send video file β Bot asks for filename
4. Reply with "MyVideo" β Bot asks for format
5. Click "Video" button β Bot processes and sends file
RenameBot/
βββ main.py # Entry point and bot initialization
βββ bot.py # Bot class and core configuration
βββ config.py # Configuration (create from sample_config.py)
βββ sample_config.py # Configuration template
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration
βββ Procfile # Deployment configuration
βββ LICENSE # MIT License
βββ README.md # This file
β
βββ database/
β βββ database.py # MongoDB operations and user management
β
βββ plugins/
β βββ __init__.py # Web server initialization
β βββ route.py # Web routing
β βββ start.py # Start command handler
β βββ report.py # Issue reporting
β β
β βββ core/
β βββ main_decorator.py # Main file processing logic
β βββ thumb.py # Thumbnail management
β βββ cleanup.py # Temporary file cleanup
β βββ progressbar.py # Progress bar utilities
β
βββ thumbnails/ # User thumbnail storage directory
- Pyrofork - Advanced Telegram client library
- Python 3.11+ - Core language
- MongoDB - User database
- PIL/Pillow - Image processing
- aiohttp - Async HTTP server
- TgCrypto - Fast encryption
docker build -t renamebot .
docker run -e BOT_TOKEN="your_token" -e API_ID="your_id" \
-e API_HASH="your_hash" -e OWNER_ID="your_id" renamebot- Click the button above
- Fill in the environment variables
- Deploy and monitor logs
Steps:
- Connect your GitHub repository
- Select Python as runtime
- Set build command:
pip install -r requirements.txt - Set start command:
python main.py - Add environment variables:
BOT_TOKENAPI_IDAPI_HASHOWNER_IDDB_URLDB_NAME
- Deploy
Steps:
- Click deploy button above
- Connect your GitHub account
- Select this repository
- Configure environment variables:
BOT_TOKEN- Your Telegram bot tokenAPI_ID- Telegram API IDAPI_HASH- Telegram API HashOWNER_ID- Your Telegram user IDDB_URL- MongoDB connection stringDB_NAME- Database namePORT- Web server port (8080)
- Click "Deploy" and wait for completion
Requirements:
- Linux VPS or Local Machine
- Python 3.11+
- MongoDB access
Installation:
# Clone repository
git clone https://github.com/OnlyNoco/RenameBot.git
cd RenameBot
# Install dependencies
pip3 install -U -r requirements.txt
# Configure
cp sample_config.py config.py
nano config.py # Edit with your credentials
# Run bot
python3 main.pyUsing Systemd (for persistent running):
sudo nano /etc/systemd/system/renamebot.serviceAdd:
[Unit]
Description=RenameBot
After=network.target
[Service]
Type=simple
User=your_user
WorkingDirectory=/path/to/RenameBot
ExecStart=/usr/bin/python3 /path/to/RenameBot/main.py
Restart=always
[Install]
WantedBy=multi-user.targetThen run:
sudo systemctl daemon-reload
sudo systemctl enable renamebot
sudo systemctl start renamebot- Verify
BOT_TOKENis correct - Check internet connection
- Ensure bot is running:
python main.py - Check logs for error messages
- Verify bot has enough disk space
- Check
DOWNLOAD_DIRpermissions - Ensure MongoDB is connected
- Send image as file, not as photo
- Ensure image file is under 5MB
- Check directory permissions for
thumbnails/
- Verify
DB_URLis correct and accessible - Check MongoDB cluster IP whitelist
- Ensure network connectivity
- Test connection string with MongoDB Compass
Contributions are welcome! Feel free to:
- π Report bugs via
/reportcommand - π‘ Suggest new features
- π§ Submit pull requests
- π Improve documentation
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to:
- β Use privately
- β Modify and distribute
- β Host yourself
We only ask that you provide proper credit by linking to the original repository.
Portfolio: onlynoco.vercel.app
Telegram: @OnlyNoco
GitHub: github.com/OnlyNoco
Join our community for more amazing bots and content:
- π¬ Battle Through The Heavens - Anime streaming and updates
- π Hentai Crisp - Adult anime content
- Mayuri-Chan - Pyrofork Library
- Lonami - PyroMod Extension
- MongoDB - Database Service
For issues, questions, or suggestions:
- Use
/reportcommand in the bot to report problems - Contact @OnlyNoco on Telegram
- Open an issue on GitHub
- Join support group for community help