A powerful and efficient Telegram bot designed to rename files and customize thumbnails with ease. Built with Pyrogram and MongoDB.
Developer: MaDuWa π¨βπ»
If you find this bot useful, please consider Forking and leaving a Star β on this repository! Your support is my biggest motivation to keep building and releasing more awesome open-source projects for the community. Let's grow together! π
- Fast Renaming: Optimized using Pyrogram for high-speed file processing.
- Custom Thumbnails: Set and save custom thumbnails for your files.
- Permanent Storage: Uses MongoDB to store user settings and thumbnails.
- FFmpeg Support: Includes FFmpeg for handling media metadata effectively.
- Multi-Platform: Easily deployable on local machines, Docker, or Cloud Platforms (Koyeb, Render, Heroku).
To run the bot, you need to configure the following environment variables:
| Variable | Description |
|---|---|
API_ID |
Your Telegram API ID from my.telegram.org. |
API_HASH |
Your Telegram API HASH from my.telegram.org. |
BOT_TOKEN |
Your Bot Token from @BotFather. |
MONGODB_URI |
Your MongoDB connection string. |
ADMIN_ID |
The Telegram User ID of the bot owner. |
DOWNLOAD_LOCATION |
Path for temporary file downloads (Default: ./downloads). |
THUMB_LOCATION |
Path for saving thumbnails (Default: ./thumbs). |
The following dependencies are required to run the bot:
pyrogram==2.0.106TgCryptomotordnspythonPillowffmpeg-pythonaiofiles
- Clone the Repository:
git clone [https://github.com/your-username/rename-bot.git](https://github.com/your-username/rename-bot.git) cd rename-bot - Install Dependencies:
pip install -r requirements.txt
- Run the Bot:
python3 bot.py
- Build the Docker Image:
docker build -t rename-bot . - Run the Container:
docker run -d --name rename-bot \ -e API_ID=123456 \ -e API_HASH="your_api_hash" \ -e BOT_TOKEN="your_bot_token" \ -e MONGODB_URI="your_mongodb_uri" \ -e ADMIN_ID=your_id \ rename-bot
- Create an account on Koyeb.
- Click on Create Service and select GitHub.
- Connect your GitHub account and select this repository.
- Choose the Dockerfile builder option.
- In the Environment Variables section, add all your config variables (API_ID, BOT_TOKEN, etc.).
- Click Deploy and wait for the build to finish.
- Create an account on Render.
- Click New and select Background Worker.
- Connect your GitHub account and select this repository.
- Set the runtime to Docker.
- Scroll down to Advanced and add your Environment Variables.
- Click Create Background Worker.
- Create an account on Heroku.
- Go to your Dashboard and click New -> Create new app.
- Go to the Settings tab and click Reveal Config Vars. Add all your environment variables here.
- Go to the Deploy tab, select GitHub as the deployment method, and connect this repository.
- Scroll down to Manual Deploy and click Deploy Branch.
- Once deployed, go to the Resources tab and turn on the worker dyno.
The project uses the following Docker configuration:
FROM python:3.9-slim
RUN apt-get update && apt-get install -y ffmpeg
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "bot.py"]